Skip to content

Conversation

@luchsamapparat
Copy link

In addition to :memory: SQLite also provides a mode=memory connection query param to instruct SQLite to use a named in-memory database. This is especially useful in combination with cache=shared since it allows the use of distinct in-memory databases within the same process (see SQLite docs.

In my case, I had issues with the in-memory database in my integration tests when using transactions as described in #229). Using cache=shared solved those issues, but introduced another: all tests now shared a common database and weren't isolated anymore. With file:memdb${randomId()}?mode=memory&cache=shared I can create a new in-memory database for each test with a shared cache.

@luchsamapparat
Copy link
Author

Hi @penberg! Could you give me feedback if this has any chance of getting merged? (or if there's something I can do to get it merged)

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

Successfully merging this pull request may close these issues.

1 participant