StitchRoomConfig

Configuration DSL for Room KMP database instances.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Custom SQLite driver. If null, the platform-best driver will be used. On most platforms, the bundled SQLite driver is recommended.

Link copied to clipboard

The journal mode for the database. Defaults to RoomDatabase.JournalMode.WRITE_AHEAD_LOGGING.

Link copied to clipboard
var logger: (String) -> Unit

The logger function used for SQL query logging. Defaults to printing to the console.

Link copied to clipboard

Whether to enable SQL query logging. If true, all executed SQL queries and their parameters will be logged using logger.

Link copied to clipboard

The strategy used to resolve the database file path. Defaults to DatabasePath.Internal.

Link copied to clipboard
var queryDispatcher: CoroutineDispatcher

Dispatcher used for database queries. Defaults to StitchRuntime.ioDispatcher.

Link copied to clipboard

Whether to use the bundled SQLite driver. If true, it overrides the driver property with a bundled driver if driver is null.

Functions

Link copied to clipboard
fun addCallbacks(vararg callback: RoomDatabase.Callback)

Adds callbacks to the database builder.

Link copied to clipboard
fun addMigrations(vararg migration: Migration)

Adds migrations to the database builder.

Link copied to clipboard
fun addTypeConverters(vararg converter: Any)

Adds type converters to the database builder.

Link copied to clipboard
fun fallbackToDestructiveMigration(dropAllTables: Boolean = true)

Allows Room to destructively recreate database tables if Migrations are not found.