Where Does NativeSqliteDriver
stores the database?
#3248
-
For my tests I have an expect/actual function that returns me a driver to test on android and on iOS. For android it's easy, in-memory. But on iOS it's a bit more complex because there is not an in-memory option. I use this: But now I changed my database schema and I'm getting execution errors on iOS because the database is not recreated and those errors doesn't go away even after a Note: I know that I could implement migrations but I don't want to. They add complexity and this feature is not launched yet so no need to give retrocompatibility. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In-memory named databases are supported, but they need to be closed after the test run, unlike unnamed in-memory connections. See usage example: 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.DatabaseFileContext.deleteDatabase("MyDb", null) |
Beta Was this translation helpful? Give feedback.
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:
But assuming you want to delete your db, this would be better:
co.touchlab.sqliter.Da…