Package app.cash.sqldelight.db

Types

Link copied to clipboard
class AfterVersion(afterVersion: Int, block: () -> Unit)

Represents a block of code block that should be executed during a migration after the migration has finished migrating to afterVersion.

Link copied to clipboard
class AfterVersionWithDriver(afterVersion: Int, block: (SqlDriver) -> Unit)

Represents a block of code block that should be executed during a migration after the migration has finished migrating to afterVersion. Unlike AfterVersion, this version's lambda accepts a SqlDriver as a parameter to make migrations easier.

Link copied to clipboard
expect interface Closeable

A type that can be closed.

actual interface Closeable
actual typealias Closeable = Closeable
actual interface Closeable
Link copied to clipboard
interface SqlCursor : Closeable

Represents a SQL result set which can be iterated through with next. Initially the cursor will not point to any row, and calling next once will iterate to the first row.

Link copied to clipboard
interface SqlDriver : Closeable

Maintains connections to an underlying SQL database and provides APIs for managing transactions and executing SQL statements.

Link copied to clipboard
interface SqlPreparedStatement

Represents a SQL statement that has been prepared by a driver to be executed.

Functions

Link copied to clipboard
fun SqlDriver.Schema.migrateWithCallbacks(driver: SqlDriver, oldVersion: Int, newVersion: Int, vararg callbacks: AfterVersionWithDriver)

Run SqlDriver.Schema.migrate normally but execute callbacks during the migration whenever it finished upgrading to a version specified by AfterVersion.afterVersion. This method takes AfterVersionWithDriver callbacks, which receive a SqlDriver parameter when invoked.

fun SqlDriver.Schema.migrateWithCallbacks(driver: SqlDriver, oldVersion: Int, newVersion: Int, vararg callbacks: AfterVersion)

Run SqlDriver.Schema.migrate normally but execute callbacks during the migration whenever it finished upgrading to a version specified by AfterVersion.afterVersion. This method takes AfterVersion callbacks, which receive no parameters when invoked.

Link copied to clipboard
Link copied to clipboard
expect inline fun <T : Closeable?, R> T.use(body: (T) -> R): R

Run body on the receiver and call Closeable.close before returning or throwing.

actual inline fun <T : Closeable?, R> T.use(body: (T) -> R): R
actual inline fun <T : Closeable?, R> T.use(body: (T) -> R): R