SQLite Android status · Issue #578 · JetBrains/Exposed · GitHub
source link: https://github.com/JetBrains/Exposed/issues/578
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSQLite Android status #578
lamba92 opened this issue on Jun 12, 2019 · 2 comments
Comments
lamba92 commented on Jun 12, 2019 •
I may be mistaken but, no JDBC driver works for SQLite on Android, which means no SQLite Exposed on Android. Here's a list of issues related to that problem: SQLDroid is out of question since the jdbc postfix is not one of the registered here, unless adding something like: registerDialect(SqlDroidDialect.dialectName) { MysqlDialect() } Anybody has a solution so far? I was happy to try Exposed on Android as well to replace Room but so far no success Digging a little deep I noticed that the problem resides in the |
Contributor
Tapac commented on Jun 12, 2019
@lamba92 Do you have any suggestion about how I could test Exposed against android sqlite? |
I'd say a Gradle module with the Android plugin. You can launch an activity and initialize something like this: class CacheTransactionManagerImpl @Inject constructor(val context: Context) : CacheTransactionManager { private val database by lazy { Database.connectSQLite(File(context.cacheDir, "localCache.sqlite").absolutePath) .also { serializableTransaction(it) { SchemaUtils.createMissingTablesAndColumns(...) } } } override fun <T> execute(block: Transaction.() -> T) = serializableTransaction(database, function = block) } You can either provide a context using DI or just creating it during execution. As soon as some R/W operation occurs, all the lazy variables will be triggered until |
No one assigned
None yet
No milestone
Successfully merging a pull request may close this issue.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK