Ddl

enum class Ddl : Enum<Ddl>

How the framework manages the structures it owns: a store's tables, collections and indexes (the logs, snapshots, timers, reservations, leases, checkpoints and the failure ledger, with their format records), the query indexes the Manifest declares, the Kafka topics and the ClickHouse tables. One setting, wow.ddl, overridden by wow.stores.<store>.ddl, wow.kafka.ddl and wow.clickhouse.ddl; each mode means the same everywhere.

Entries

Link copied to clipboard

Creates what is missing, then checks the format of what exists: the default.

Link copied to clipboard

Creates nothing and checks that each structure exists in the format this version reads: for an account without DDL rights, whose schema a migration or an earlier auto run created. A missing or incompatible one refuses the startup, naming what is missing.

Link copied to clipboard

Creates and checks nothing: the schema is someone else's, and a missing structure fails at its first use.

Companion properties

Link copied to clipboard

Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.

Companion functions

Link copied to clipboard
fun valueOf(value: String): Ddl

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard
fun values(): Array<Ddl>

Returns an array containing the constants of this enum type, in the order they're declared.

Properties

Link copied to clipboard

Whether this mode checks what exists: AUTO and VALIDATE.

Link copied to clipboard

Whether this mode creates what is missing: AUTO.

Functions

Link copied to clipboard
inline fun apply(describe: String, exists: () -> Boolean = { false }, create: () -> Unit, validate: () -> Unit)

Makes sure of the structure describe names as this mode says, with the backend's native checks: under AUTO creates it unless exists says it is there, and validates it when it is; under VALIDATE refuses it, naming it, when it does not exist, and validates it when it does; under NONE does nothing. A backend whose create is idempotent and checks what it finds leaves exists out: it then always creates.

Link copied to clipboard
inline fun ensure(missing: String, create: () -> Unit, validate: () -> Boolean)

Makes sure of the structure missing names as this mode says, with no round trip to ask whether it exists: under AUTO creates it, which must be idempotent (CREATE … IF NOT EXISTS, an index creation, a format record claimed), then validates it; under VALIDATE validates it alone; under NONE does nothing. validate checks the format of what it finds and answers whether the structure exists; one that does not refuses the startup, naming it.