DriverFactory

actual class DriverFactory
actual class DriverFactory
expect class DriverFactory

Platform-specific factory for creating SQLite database drivers. Each platform (Android, iOS, JVM) provides its own implementation.

Constructors

Link copied to clipboard
constructor(context: Context, logBlock: (String) -> Unit? = null)
constructor(logBlock: (String) -> Unit? = null)

Functions

Link copied to clipboard
actual fun createDriver(filePath: String): SqlDriver

Creates a database driver from a direct file path. Opens the database directly without copying.

actual fun createDriver(name: String?, replaceDatabase: Boolean, completionHandler: (Boolean) -> Unit): SqlDriver

Creates a database driver from assets. Copies the database from assets to the app's database directory.

actual fun createDriver(filePath: String): SqlDriver

Creates a database driver from a direct file path. Opens the database directly without copying.

actual fun createDriver(name: String?, replaceDatabase: Boolean, completionHandler: (Boolean) -> Unit): SqlDriver

Creates a database driver from bundle. Copies the database from bundle to Application Support directory.

expect fun createDriver(filePath: String): SqlDriver

Creates a platform-specific SQLite database driver from a direct file path. No copying occurs - the database is opened directly from the provided path in read-only mode.

expect fun createDriver(name: String?, replaceDatabase: Boolean, completionHandler: (Boolean) -> Unit): SqlDriver

Creates a platform-specific SQLite database driver from assets/bundle. The database file will be copied from assets/bundle to a writable location.