open
Opens a connection to the database using KQLiteDriver.open and handles schema creation, upgrades, or downgrades if required.
This method is thread safe.
The opened connection is cached internally and can be accessed via getConnection for subsequent operations. Same connection instance will be used to execute queries if connection is not provided to execute method.
Example
myDatabase.open().use {
Employees
.select()
.where {
it.leaveCount.BETWEEN(15..25)
}.execute()
.forEach {
println(it[Employees.firstName])
}
}Content copied to clipboard
Return
An active SQLiteConnection to the database.
Author
MOHAMMAD AZIM ANSARI
Parameters
flags
Optional flags to pass to the underlying SQLite driver when opening the connection. These are platform-specific (e.g., SQLiteDatabase.OPEN_READONLY).
See also
Throws
if database cannot be opened successfully or the provided version is negative or if a required migration is not found in getKQLiteMigrations list.