Comments (2)
Hi @jon49 thanks for the suggestion.
Just to clarify, you mean cache the generated SQL statement (e.g. SELECT ... FROM ...) for a given LINQ/Lambda expression?
Should be possible, I'll just need to figure out a way to verify the "uniqueness" of a query based on the expression tree... Run time variables might be a problem too, but I can try and have a go at it.
from linq-to-dapper.
Yes, I was thinking of the resulting SQL statement. It would be interesting to do perf tests on it first to see how fast your lib goes to begin with. I imagine it wouldn't be that fast since you have to do all the work just to get to the SQL Statement.
That is why I was wondering if it would be possible, or if it is even worth it.
Here's some bench marks that it could be based off of to see where Linq2Dapper resides:
https://github.com/MoonStorm/Dapper.FastCRUD#speed
https://github.com/StackExchange/Dapper#performance-of-select-mapping-over-500-iterations---poco-serialization
I was originally thinking of doing something like this:
private static object myqueryUniqueIdentifier = new object();
...
var thing =
(from a in _connection.Query<ModelName>(myqueryUniqueIdentifier)
where a.Id == 1
select a).Single();
Maybe even use a JS-like Symbol object.
I'm not sure if there would be a more elegant way to do it in C#.
I wish I had more bandwidth to help out a lot more with this! Seems like a great project! Get the full static typing like other heavy projects but close to the perf Dapper! I would think that caching the result would get it really close.
from linq-to-dapper.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linq-to-dapper.