DatabaseBuilder

abstract class DatabaseBuilder

Abstract builder class for constructing a DatabaseProvider.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

When true, org.jetbrains.exposed.v1.jdbc.SchemaUtils.createMissingTablesAndColumns is used instead of org.jetbrains.exposed.v1.jdbc.SchemaUtils.create, so new columns added to existing tables are applied automatically on start-up.

Link copied to clipboard

The database configuration.

Functions

Link copied to clipboard
abstract fun build(): DatabaseProvider

Builds and returns a DatabaseProvider instance.

Link copied to clipboard
fun config(config: DatabaseConfig)

Sets the database configuration.

fun config(driver: String, url: String, user: String = "", password: String = "")

Sets the database configuration using individual parameters.

Link copied to clipboard
fun migrate(vararg migration: Migration)

Registers one or more Migration steps. Migrations are applied in ascending Migration.version order after schema initialisation.

Link copied to clipboard
fun <T : Table> register(table: T): T

Registers a table to the database.

Link copied to clipboard
fun table(vararg table: Table)

Registers one or more tables to the database. These tables will be created or updated upon initialization.