schema

Returns a KQLiteSchema instance for performing schema-related operations like creating or dropping tables.

This function provides a convenient, high-level API for managing the database schema. You can use it within a migration or a transaction to perform schema modifications.

Example

class MyMigration : KQLiteMigration(1, 2) {
override fun migrate(database: KQLiteDatabase) {
// Retrieve KQLiteSchema instance
val schema = database.schema()

// Create a new table
schema.createTable(NewTable)

// Drop a VIEW
schema.dropView("old_view")

// ALTER a table
schema.alterTable(MyTable).addColumn(MyTable.birthDate)
}
}

Return

A KQLiteSchema instance bound to the current database connection.

See also

Throws

if the database connection has not been established via open().