Hierarchy

  • ConstraintParser

Constructors

Properties

CONSTRAINT_PATTERN_DEFINITION_GROUP: number = 3

Constraint name and definition pattern definition matcher group

CONSTRAINT_PATTERN_NAME_GROUP: number = 2

Constraint name and definition pattern name matcher group

NAME_PATTERN_NAME_GROUP: number = 1

Constraint name pattern name matcher group

Methods

  • Attempt to get the constraint by parsing the SQL statement

    Returns

    constraint or null

    Parameters

    • constraintSql: string

      constraint SQL statement

    • table: boolean

      true to search for a table constraint, false to search for a column constraint

    Returns Constraint

  • Get the constraint name if it has one

    Returns

    constraint name or null

    Parameters

    • constraintSql: string

      constraint SQL

    Returns string

  • Get the constraint name and remaining definition

    Returns

    array with name or null at index 0, definition at index 1

    Parameters

    • constraintSql: string

      constraint SQL

    Returns string[]

  • Check if the SQL is a column type constraint

    Returns

    true if a column constraint

    Parameters

    • constraintSql: string

      constraint SQL statement

    Returns boolean

  • Check if the SQL is a constraint

    Returns

    true if a constraint

    Parameters

    • constraintSql: string

      constraint SQL statement

    Returns boolean

  • Check if the SQL is a table type constraint

    Returns

    true if a table constraint

    Parameters

    • constraintSql: string

      constraint SQL statement

    Returns boolean

Generated using TypeDoc