Metakit / @doeixd/metakit/sql
toCheck
function · packages/metakit/src/sql.ts:115
function toCheck<S extends Schema.Top>(
schema: S,
options?: {
readonly dialect?: SqlDialect
readonly column?: ColumnName
},
): Result.Result<string, SqlUnsupportedError>Every rule of schema as a SQL CHECK (...) clause. The check fails where
a rule is unknown of a null, as the Schema refuses that value. Literals are
written into the text, since DDL takes no parameters.