Daniele B
05/26/2021, 6:06 PMval sqlDriver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
however when I make a DB operation, I get this error:
Exception in thread "AWT-EventQueue-0 @coroutine#4" org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: Countries)
full stacktrace in the comment
(using com.squareup.sqldelight:sqlite-driver:1.5.0
)Daniele B
05/26/2021, 6:07 PMException in thread "AWT-EventQueue-0 @coroutine#4" org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: Countries)
at org.sqlite.core.DB.newSQLException(DB.java:1012)
at org.sqlite.core.DB.newSQLException(DB.java:1024)
at org.sqlite.core.DB.throwex(DB.java:989)
at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
at org.sqlite.core.NativeDB.prepare(NativeDB.java:134)
at org.sqlite.core.DB.prepare(DB.java:257)
at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:45)
at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:30)
at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:25)
at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:35)
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:241)
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:205)
at com.squareup.sqldelight.sqlite.driver.JdbcDriver.execute(JdbcDriver.kt:106)
at mylocal.db.shared.CountriesQueriesImpl.upsertCountry(LocalDbImpl.kt:107)
at eu.baroncelli.dkmpsample.shared.datalayer.sources.localdb.countries.CountriesFunctionsKt$setCountriesList$1.invoke(CountriesFunctions.kt:13)
at eu.baroncelli.dkmpsample.shared.datalayer.sources.localdb.countries.CountriesFunctionsKt$setCountriesList$1.invoke(CountriesFunctions.kt)
at com.squareup.sqldelight.TransacterImpl.transactionWithWrapper(Transacter.kt:218)
at com.squareup.sqldelight.TransacterImpl.transaction(Transacter.kt:197)
at com.squareup.sqldelight.Transacter$DefaultImpls.transaction$default(Transacter.kt:82)
at eu.baroncelli.dkmpsample.shared.datalayer.sources.localdb.countries.CountriesFunctionsKt.setCountriesList(CountriesFunctions.kt:11)
at eu.baroncelli.dkmpsample.shared.datalayer.functions.GetCountriesListKt$getCountriesListData$2.invokeSuspend(GetCountriesList.kt:22)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
alec
05/26/2021, 6:13 PMalec
05/26/2021, 6:14 PMDaniele B
05/26/2021, 6:14 PMDaniele B
05/26/2021, 6:15 PMDaniele B
05/26/2021, 6:28 PMJohn O'Reilly
05/26/2021, 6:31 PMDaniele B
05/26/2021, 6:34 PMval databasePath = File(System.getProperty("java.io.tmpdir"), "ComposeTodoDatabase.db")
val driver = JdbcSqliteDriver(url = "jdbc:sqlite:${databasePath.absolutePath}")
TodoDatabase.Schema.create(driver)
while PeopleInSpace is using:
val driver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
.also { PeopleInSpaceDatabase.Schema.create(it) }
PeopleInSpaceDatabaseWrapper(PeopleInSpaceDatabase(driver))
what the difference?
are they both saving the db on the disk?John O'Reilly
05/26/2021, 6:36 PMDaniele B
05/26/2021, 6:38 PMJohn O'Reilly
05/26/2021, 6:38 PMJohn O'Reilly
05/26/2021, 6:39 PMDaniele B
05/26/2021, 6:40 PMDaniele B
05/26/2021, 6:41 PMNikky
05/27/2021, 9:36 AM