iya-sts
    Preparing search index...

    Reads both MariaDB DDL copies and emits the SQL file unchanged.

    Index
    • An identifier with its quotes removed.

      Parameters

      • token: string

        one primary-key column

      Returns string

      the name

    • Builds a model from texts the caller already has. Tests pass a fixture here without loading the schema module.

      Parameters

      • sql: string

        the schema script

      • schemaModule: any

        schema_mariadb.js exports, or null

      Returns MdModel

      the model

    • One column piece. A back-quoted name is the same column as an unquoted one.

      Parameters

      • piece: string

        trimmed SQL

      Returns MdColumn

      the column, or null

    • Records a create the two copies do not share. Whitespace is not a difference: squash() is the same collapse as tests/mariadb_schema.js.

      Parameters

      • scriptObjects: MdObject[]

        creates from the SQL file

      • objects: MdObject[]

        creates from the module

      • gaps: MdGap[]

        the gap list

      Returns void

    • CREATE statements in the script, comments removed, each without its semicolon. The cut is tests/mariadb_schema.js's: a semicolon ends the statement, and the two copies are compared after squash().

      Parameters

      • sql: string

        the script

      Returns MdObject[]

      the creates, in script order

    • The SQL file, unchanged.

      Parameters

      • model: MdModel

        a model from read() or build()

      Returns string

      the file bytes stored on the model

    • A table-body piece that is a key or a check, not a column. KEY is MariaDB's inline index. A column named key is back-quoted, so it does not start with that word.

      Parameters

      • piece: string

        trimmed SQL

      Returns boolean

      whether the piece is a constraint

    • The module's objects, in its order, as the strings it exports.

      Parameters

      • schemaModule: any

        the module exports, or null

      Returns MdObject[]

      the objects

    • Reads the schema file and the driver's statement list.

      Parameters

      • root: string

        the package root

      Returns MdModel

      the model. sql is the file's bytes.

    • Splits on commas that are not inside parentheses, quotes, or back-quotes.

      Parameters

      • body: string

        a CREATE TABLE body

      Returns string[]

      the pieces, untrimmed

    • The type tokens at the start of a column's remainder, including a length. unknown is a type this schema does not use.

      Parameters

      • rest: string

        the SQL after the column name

      Returns string

      the type, or unknown

    • Collapses whitespace the way tests/mariadb_schema.js does, so a gap here is a gap that test would also report.

      Parameters

      • text: string

        one statement

      Returns string

      the comparable text

    • The index of the semicolon that ends the statement at start. Quotes and back-quotes are skipped, so a semicolon inside one is not the end.

      Parameters

      • code: string

        the script with comment lines removed

      • start: number

        the start of the statement

      Returns number

      the index of ;, or the length

    • One table body.

      Parameters

      • name: string

        the table

      • raw: string

        the text inside the parentheses

      • engine: string

        the clause between ) and ;

      • gaps: MdGap[]

        the gap list

      Returns MdTable

      the table

    • Every CREATE TABLE, with the engine clause that follows the body.

      Parameters

      • sql: string

        the script

      • gaps: MdGap[]

        the gap list

      Returns MdTable[]

      the tables, in script order