Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to introduce compiler for in-memory data? #649

Open
nikhilsarvaiye opened this issue Dec 16, 2022 · 5 comments
Open

Any plans to introduce compiler for in-memory data? #649

nikhilsarvaiye opened this issue Dec 16, 2022 · 5 comments

Comments

@nikhilsarvaiye
Copy link

Any plans to introduce compiler for in-memory data in lists, collections? which can be useful in case of caching like Redis, or for general code performance.

I would love to know your thoughts, if would like I can contribute, thoughts?

@ahmad-moussawi
Copy link
Contributor

Nice idea!, but I don't think it's a matter of the compiler only. The job of a compiler is to convert C# statements to SQL string statements, so maybe a package with a broader scope would be needed in this case.

@nikhilsarvaiye
Copy link
Author

nikhilsarvaiye commented Dec 16, 2022

Right, I would say we build Query and then Query to filter in-memory dictionaries. This way we can reuse the query object, I also have few ideas where and how joins can work in memory...

@Cricle
Copy link

Cricle commented Jan 14, 2023

I think DataTable.Select can use

@michaelkruglos
Copy link

Has anyone tried SQLite in-memory feature?
I've found this, but I haven't tried it yet.
It sure seems as a viable solution for unit tests, where you would use it for in-memory mock DB.

@ahmad-moussawi
Copy link
Contributor

ahmad-moussawi commented Aug 3, 2023

The unit tests already use this, I think you can follow the same approach

https://github.com/sqlkata/querybuilder/blob/master/QueryBuilder.Tests/SQLiteExecutionTest.cs#L263-L267

var cs = $"Data Source=file::memory:;Cache=Shared";
var connection = new SqliteConnection(cs);
var db = new QueryFactory(connection, new SqliteCompiler());       

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants