Hi, can I use multiple database files with same sc...
# multiplatform
a
Hi, can I use multiple database files with same schema in KMM using SQL Delight. For my use-case, I am trying to provide multiple user login, I want separate database instances for each user in the same app.
a
Are the users going to use the app simultaneously?
a
@Arjan van Wieringen Not simultaneously, I don't need multiple db connections at the same time, but need to switch between databases (created with the same schema) when users are switched. For example, in android, I can open database connections to multiple databases with different names by passing database path.
p
When you create the
AndroidSqliteDriver
and the
NativeSqliteDriver
the value you pass for the “name” field determines the DB filename. In theory you could reinitialize, use a new driver instance, and switch files since the Schema parameter is separate from the name.