Validate a schema or table name against NAME_PATTERN.
Whether this is a schema or table name (used in the error message).
schema
table
The name to check.
InvalidNameError if the name is empty or contains disallowed characters.
validateName('schema', 'antinuke'); // okvalidateName('schema', 'anti nuke'); // throws InvalidNameErrorvalidateName('table', 'settings; DROP'); // throws InvalidNameError Copy
validateName('schema', 'antinuke'); // okvalidateName('schema', 'anti nuke'); // throws InvalidNameErrorvalidateName('table', 'settings; DROP'); // throws InvalidNameError
Validate a schema or table name against NAME_PATTERN.