Repodb.Ddl.S
repodb · API reference
Dialect-aware DDL facade for schemas and migrations.
Ddl.Make(D) binds Schema and Migration rendering to a concrete driver dialect. It is a small convenience layer for migration runners, admin CLIs, and tests that need to render DDL using the same dialect as the connection they will execute against.
module Ddl = Repodb.Ddl.Make (Repodb_postgresql.Driver)
let sql = Ddl.schema_to_sql User.table_def
let actions = Ddl.plan_migrate ~applied_versions:[] ~target:None migrations
let statements = List.concat_map Repodb.Migration.action_to_sql actionsThe facade does not execute SQL. Pair it with a concrete Repo.Make.Ddl module or the driver's exec function when building a migration runner.
val dialect : Driver.dialectval schema_to_sql : Schema.table_def -> stringval migration_operation_to_sql : Migration.operation -> stringval generate_up_sql : Migration.t -> string listval generate_down_sql : Migration.t -> string listval create_schema_migrations_sql : stringval insert_migration_sql : stringval delete_migration_sql : stringval plan_migrate :
applied_versions:int64 list ->
target:int64 option ->
Migration.t list ->
Migration.migration_action listval plan_rollback :
applied_versions:int64 list ->
step:int option ->
Migration.t list ->
Migration.migration_action list