Comments (4)
Seems like you're using the same filename for both. Where's your driver initialization code?
from sqldelight.
Seems like you're using the same filename for both. Where's your driver initialization code?
I call this function to create any db
override fun createDriver(): SqlDriver {
val factory = SupportOpenHelperFactory(databaseInfo.password.toByteArray(StandardCharsets.UTF_8))
return AndroidSqliteDriver(
schema = databaseInfo.schema,
context = context,
name = databaseInfo.name,
factory = factory,
callback = object : AndroidSqliteDriver.Callback(databaseInfo.schema) {
override fun onOpen(db: SupportSQLiteDatabase) {
db.setForeignKeyConstraintsEnabled(true)
}
}
)
}
from sqldelight.
Seems like you're using the same filename for both. Where's your driver initialization code?
Even if I use different db name it gets override with last db initialization/creation. First db is not created/overrriden
from sqldelight.
Seems like you're using the same filename for both. Where's your driver initialization code?
Driver is initialized in Myapplication
initKoin(androidContext(this@MyApplication) modules( createDbModule( DatabaseInfo( schema = coreDatabaseSchema, name = CORE_DB_NAME, password = resources.getString(R.string.app_name) ) ), coreDatabaseFactory, createDbModule( DatabaseInfo( schema = musicDatabaseSchema, name = MUSIC_DB_NAME, password = resources.getString(R.string.app_name) ) ), musicDatabaseFactory ) }
Hope this gives some insight.
We have 2 usecase
1. With different DB_NAME only last db is created/overriden
2. With same DB_Name i have issue with version conflict on db creation
I tried with 2.0.0 still same issue
from sqldelight.
Related Issues (20)
- com.alecstrong.sql.psi.core.psi.InvalidElementDetectedException in ElementTypes.kt:7
- VerifyMigration gives weird false positive after upgrading to 2.0 HOT 1
- Issues compiling JS target on KMP HOT 1
- [PostgreSQL Dialect]: Support `ORDER BY .. NULLS [FIRST|LAST]`
- Inconsistent result type inference of built-in functions
- java.lang.NoSuchMethodError in MySqlTypeResolver.kt:60
- org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments in SqlDelightFindUsagesHandlerFactory.kt:85
- java.lang.Exception in SqlDelightFindUsagesHandlerFactory.kt:85
- verifyDebugDatabaseMigration fails on Windows HOT 1
- java.util.NoSuchElementException in TypeResolver.kt:115
- org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException in KotlinBuiltIns.java:93
- org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException in SqlDelightGotoDeclarationHandler.kt:124
- com.intellij.diagnostic.PluginException in FileIndexingNotification.kt:47
- java.lang.NullPointerException in ConnectionOptions.kt:57
- SQLite migrations are not run inside transactions as mentioned in documentation HOT 1
- Columns having reserved (SQLite) keywords cause crash during insert
- java.lang.IndexOutOfBoundsException in TreeUtil.kt:59
- Cannot find service com.intellij.workspaceModel.core.fileIndex.WorkspaceFileIndex HOT 2
- Unable to use `:` and conditional `WHERE` in Sql Query
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqldelight.