John O'Reilly
09/27/2020, 2:50 PMkodein-db
, am calling val db = DB.open("bikeshare_db")
but getting
org.kodein.db.leveldb.LevelDBException: NotFound: bikeshare_db/LOCK: No such file or directory
it seemed from https://docs.kodein.org/kodein-db/0.2.0/core/setup-database.html that the default is to create the database if it does not exist?romainbsl
09/27/2020, 7:06 PMDB.factory.inDir(getApplicationFilesDirectoryPath(di))
where getApplicationFilesDirectoryPath
is an expect functionromainbsl
09/27/2020, 7:08 PMactual fun getApplicationFilesDirectoryPath(di: DI): String =
NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0] as String
And Android
actual fun getApplicationFilesDirectoryPath(di: DI): String =
di.direct.instance<Context>(tag = "app").filesDir.absolutePath
romainbsl
09/27/2020, 7:09 PMJohn O'Reilly
09/27/2020, 7:09 PMromainbsl
09/27/2020, 7:13 PMJohn O'Reilly
09/27/2020, 7:13 PMDI
type above?romainbsl
09/27/2020, 7:15 PMJohn O'Reilly
09/27/2020, 7:15 PMromainbsl
09/27/2020, 7:15 PMromainbsl
09/27/2020, 7:16 PMJohn O'Reilly
09/27/2020, 7:16 PMromainbsl
09/27/2020, 7:16 PMJohn O'Reilly
10/03/2020, 4:52 PMJohn O'Reilly
10/03/2020, 4:56 PMJohn O'Reilly
10/03/2020, 4:56 PMromainbsl
10/05/2020, 7:15 AMJohn O'Reilly
10/05/2020, 7:57 AM