sql-switch - v1.0.1
    Preparing search index...

    Function validateName

    • Validate a schema or table name against NAME_PATTERN.

      Parameters

      • kind: "schema" | "table"

        Whether this is a schema or table name (used in the error message).

      • name: string

        The name to check.

      Returns void

      InvalidNameError if the name is empty or contains disallowed characters.

      validateName('schema', 'antinuke');    // ok
      validateName('schema', 'anti nuke'); // throws InvalidNameError
      validateName('table', 'settings; DROP'); // throws InvalidNameError