-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Pragma Settings for SQLite #5024
Comments
You need to do it in the same context as where you are doing the EF data access |
Can you please elaborate? |
@natemcmaster can you confirm? |
@natemcmaster ping 😄 |
@shlatchz if you want to issue custom pragma statements, you need to do this every time you open a connection. Changing values via pragma statements do not persist across calls to Moving up a layer in the stack. EntityFramework Core has a class that wraps |
Remarking for triage: what is the work here? Add API to Microsoft.Data.Sqlite or EF? |
@natemcmaster this is mostly to investigate and work out what we should do. It seems like we may want a way to easily configure pragma settings when you setup the context to target SQLite. Or it may be a more general "connection preamble" feature. It's in the 1.0.1 milestone to look at post-RTM though |
I have this given this some consideration and prototyped some designs today. My current thinking leads me to believe we should consider this a duplicate of the lifecycle hooks feature (#626). Most designs I came up with end up working essentially like a general connection preamble feature. This general feature has bigger implications than just SQLite pragmas, so we should probably gather for some design work on this first. |
Closing this issue as the idea of connection preamble is being tracked as part of the bigger Lifecycle Hooks feature (#626). |
BTW just to make it explicit - we are not closing this because we aren't planning to implement it. We very much agree this is super useful, it's just already tracked as part of #626. |
Fix pragmas to apply everytime a connection is opened per dotnet/efcore#5024
* Fix first run bug. * Remove unneeded .ToArray() * Delete SqliteFilename * Fix Roslyn Warnings * Update DatabaseManager.cs * Update InsertTestsWithIntermittentTransactions.cs * Allow journal mode configuration Fix pragmas to apply everytime a connection is opened per dotnet/efcore#5024 * Use a settings object for passing database settings. Add a few more settings (pragma passthroughs). * Add CommitTests * Rename files. * Move/Rename files. Adds Query Tests * Update QueryTests.cs Documentation * Make Synchronous a string so the values are more obvious * Code Cleanup * Add LiteDbManager placeholder. * Add prelim litedb support (for benchmarking). * Progress towards LiteDb Benchmark * Small fixes * Update LiteDbManager.cs * Add System.Data.Sqlite implementation of DB manager * Add nullable checks. * Nullable fixes * More nullable fixes * Nullable Fixes pt. 1 Mostly finished with lib. * Finish nullable work in lib Aside from the experimental litedb work. * More nullable fixes. * More nullable work. Re-adds SystemSQLite support. * Fixes for SystemSQLite support * Finish nullable work * clean up GetCollectModified * Add LiteDb Query Tests * Move System.Data.SQLite and LiteDB code into the benchmarks Removes those dependencies from the main library and cli. * Fix null reference exceptions * Remove old default arguments We now use null * Add a GetAllMissing function * Update BaseCompare to use GetAllMissing * Fix constructors so Objects are properly deserializable. * Add new GetAllMissing2 function This is a hybrid between the two approaches. * Adds crypto tests * Pull get missing query out out function * Update FileSystemCollector.cs * Update csproj files to improve assembly names * Update csproj and pipelines * Fix pipelines * Rename tests file. * Update to use SHA512 * Nullable work. * Fix build. * Help the pipeline find the tests properly * Update Strings.cs * Update Strings.cs * Update AsaLibTests.cs * Update pr-validation.yml Now properly fail when tests fail but still report test results. * Add BatchSize for writenext * Update SqlConnectionHolder.cs * Update SqlConnectionHolder.cs * Update batching * fix race condition * Update InsertTestsWithoutTransactions.cs * Fix batch size default and max batch size. * Fix comobjectcollector * Fix registry collector. * Centralize code for translating sid to names Only attempt to do so when it could possibly succeed, this reduces number of exceptions dramatically. * Update AsaLibTests.cs * Update AsaLibTests.cs * Fix registry objects to distinguish which view they were gathered from. * Gather Com Objects in Both Views
The following code
cannot receive pragma settings such as journalmode or syncmode.
How can I apply the pragma settings to the db?
I tried:
but it didn't help.
The text was updated successfully, but these errors were encountered: