StaticassertThrows when after drops or retypes something before has.
the earlier model
the candidate
StaticattachWrites the lookup links onto columns the script actually has.
parsed tables
the gap list
StaticbuildBuilds a model from texts the caller already has. Tests pass a fixture here without loading the driver.
the schema script
the driver's exported lists, or null in a fixture
the MariaDB module source, or empty
the model
StaticcolumnOne column piece. A piece that does not start with an identifier is not a column.
trimmed SQL
the column, or null
StaticemitThe SQL file, unchanged.
a model from read() or build()
the file bytes stored on the model
StaticmariadbPostgreSQL tables whose name the MariaDB file does not use.
parsed PostgreSQL tables
schema_mariadb.js text
the gap list
StaticmatchingThe index of the parenthesis matching open.
the script
the index of (
the index of ), or -1
StaticnormalizeCollapses whitespace. The two DDL copies differ only by it.
one statement
the comparable text
StaticparseChecks one row against the column types the DDL states. unknown
accepts any JSON value, which is what an unmapped type and jsonb
are here. This does not replace the driver.
the model
the table
the candidate row
whether it matches
StaticplaceFinds each table's statement, so the model can say where in the script it runs and what follows its closing parenthesis. A table rebuilt from its columns that is not the script's statement is a gap.
parsed tables
the script's statements
the gap list
StaticquotedA quoted span, with doubled quotes kept.
the text
the opening quote
' or "
the span including quotes, and the index after it
StaticreadReads the schema file and the driver's statement lists.
the package root
the model. sql is the file's bytes.
StaticrebuildOne table's CREATE statement, from its parts.
the table
the statement, whitespace normalized
StaticshapeProblems that would drop or retype a table or a column. Empty when
after still has everything before has, with the same type token.
the earlier model
the model a later emit would write
the problems
StaticsplitSplits on commas that are not inside parentheses or quotes.
a CREATE TABLE body
the pieces, untrimmed
StaticsqlThe type tokens at the start of a column's remainder.
the SQL after the column name
the type, or unknown when it does not match
StaticstatementsNormalized statements, comments and psql meta-commands removed.
Semicolons inside dollar quotes stay inside the statement. This is
the same whitespace rule as tests/postgres_schema.js.
the script
the statements
StatictableOne table body.
the table
the text inside the parentheses
the gap list
the table
StatictablesEvery CREATE TABLE, with columns split at depth zero.
the script
the gap list
the tables, in script order
StatictakeCopies the driver's lists and records a gap wherever the script
comparison used by tests/postgres_schema.js would fail.
the model being filled
persistence_postgres.js exports
normalized script statements
the gap list
StaticzodA Zod schema for one SQL type token.
the type from the column
the schema
Reads both DDL copies and emits the SQL file unchanged.