Skip to content

//runtime/com.squareup.sqldelight.db/SqlDriver/Schema

Schema

[common] interface Schema

API for creating and migrating a SQL database.

Functions

Name Summary
create [common]
Content
abstract fun create(driver: SqlDriver)
More info
Use driver to create the schema from scratch.


migrate [common]
Content
abstract fun migrate(driver: SqlDriver, oldVersion: Int, newVersion: Int)
More info
Use driver to migrate from schema oldVersion to newVersion.


Properties

Name Summary
version [common] abstract val version: IntThe version of this schema.

Extensions

Name Summary
migrateWithCallbacks [common]
Content
fun SqlDriver.Schema.migrateWithCallbacks(driver: SqlDriver, oldVersion: Int, newVersion: Int, vararg callbacks: AfterVersion)
fun SqlDriver.Schema.migrateWithCallbacks(driver: SqlDriver, oldVersion: Int, newVersion: Int, vararg callbacks: AfterVersionWithDriver)
More info
Run SqlDriver.Schema.migrate normally but execute callbacks during the migration whenever it finished upgrading to a version specified by AfterVersion.afterVersion.