Skip to content

Where Does NativeSqliteDriver stores the database? #3248

Answered by kpgalligan
BraisGabin asked this question in Q&A
Discussion options

You must be logged in to vote

In-memory named databases are supported, but they need to be closed after the test run, unlike unnamed in-memory connections. See usage example:

https://github.com/touchlab/KaMPKit/blob/35b27341fdda627a0857d36c15bd0adf442df0a2/shared/src/iosTest/kotlin/co/touchlab/kampkit/TestUtilIOS.kt#L9

I added a PR to support unnamed in-memory connections as they've been regularly requested, but (assuming that's approved) it'll be released in 2.x rather than 1.5.x: #3249

As to your original question, probably the easiest way to find the db on disk is:

co.touchlab.sqliter.DatabaseFileContext.databasePath("MyDb", null)

But assuming you want to delete your db, this would be better:

co.touchlab.sqliter.Da…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BraisGabin
Comment options

Answer selected by BraisGabin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants