sql-formatter
Advanced tools
Comparing version 9.0.0-beta.5 to 9.0.0-beta.6
@@ -50,7 +50,6 @@ "use strict"; | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// DQL, https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax | ||
'SELECT', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'ORDER BY', 'QUALIFY', 'WINDOW', 'PARTITION BY', 'LIMIT', 'OFFSET', 'WITH', 'OMIT RECORD IF', // legacy | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// Queries: https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT] [AS STRUCT | AS VALUE]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'QUALIFY', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'OMIT RECORD IF', // legacy | ||
// DML, https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax | ||
'INSERT [INTO]', 'VALUES', 'DELETE [FROM]', 'TRUNCATE TABLE', 'UPDATE', 'MERGE [INTO]', // 'USING', | ||
// DDL, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language | ||
'INSERT [INTO]', 'VALUES', 'DELETE [FROM]', 'TRUNCATE TABLE', 'UPDATE', 'MERGE [INTO]', // DDL, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language | ||
'CREATE SCHEMA [IF NOT EXISTS]', 'DEFAULT COLLATE', 'CREATE [OR REPLACE] [TEMP|TEMPORARY|SNAPSHOT|EXTERNAL] TABLE [IF NOT EXISTS]', 'CLUSTER BY', 'FOR SYSTEM_TIME AS OF', // CREATE SNAPSHOT TABLE | ||
@@ -57,0 +56,0 @@ 'CREATE [OR REPLACE] [MATERIALIZED] VIEW [IF NOT EXISTS]', 'WITH CONNECTION', 'WITH PARTITION COLUMNS', 'CREATE [OR REPLACE] [TEMP|TEMPORARY|TABLE] FUNCTION [IF NOT EXISTS]', 'REMOTE WITH CONNECTION', 'RETURNS TABLE', 'CREATE [OR REPLACE] PROCEDURE [IF NOT EXISTS]', 'CREATE [OR REPLACE] ROW ACCESS POLICY [IF NOT EXISTS]', 'GRANT TO', 'FILTER USING', 'CREATE CAPACITY', 'AS JSON', 'CREATE RESERVATION', 'CREATE ASSIGNMENT', 'CREATE SEARCH INDEX [IF NOT EXISTS]', 'ALTER SCHEMA [IF EXISTS]', 'SET DEFAULT COLLATE', 'SET OPTIONS', 'ALTER TABLE [IF EXISTS]', 'ADD COLUMN [IF NOT EXISTS]', 'RENAME TO', 'DROP COLUMN [IF EXISTS]', 'ALTER COLUMN [IF EXISTS]', 'DROP NOT NULL', 'SET DATA TYPE', 'ALTER [MATERIALIZED] VIEW [IF EXISTS]', 'ALTER BI_CAPACITY', 'DROP SCHEMA [IF EXISTS]', 'DROP [SNAPSHOT|EXTERNAL] TABLE [IF EXISTS]', 'DROP [MATERIALIZED] VIEW [IF EXISTS]', 'DROP [TABLE] FUNCTION [IF EXISTS]', 'DROP PROCEDURE [IF EXISTS]', 'DROP ROW ACCESS POLICY', 'DROP ALL ROW ACCESS POLICIES', 'DROP CAPACITY [IF EXISTS]', 'DROP RESERVATION [IF EXISTS]', 'DROP ASSIGNMENT [IF EXISTS]', 'DROP SEARCH INDEX [IF EXISTS]', 'DROP [IF EXISTS]', // DCL, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-control-language |
@@ -44,7 +44,8 @@ "use strict"; | ||
// https://www.ibm.com/docs/en/db2-for-zos/11?topic=statements-list-supported | ||
var reservedCommands = ['ALLOCATE CURSOR', 'ALTER DATABASE', 'ALTER FUNCTION', 'ALTER INDEX', 'ALTER MASK', 'ALTER PERMISSION', 'ALTER PROCEDURE', 'ALTER SEQUENCE', 'ALTER STOGROUP', 'ALTER TABLE', 'ALTER TABLESPACE', 'ALTER TRIGGER', 'ALTER TRUSTED CONTEXT', 'ALTER VIEW', 'ASSOCIATE LOCATORS', 'BEGIN DECLARE SECTION', 'CALL', 'CLOSE', 'COMMENT', 'COMMIT', 'CONNECT', 'CREATE ALIAS', 'CREATE AUXILIARY TABLE', 'CREATE DATABASE', 'CREATE FUNCTION', 'CREATE GLOBAL TEMPORARY TABLE', 'CREATE INDEX', 'CREATE LOB TABLESPACE', 'CREATE MASK', 'CREATE PERMISSION', 'CREATE PROCEDURE', 'CREATE ROLE', 'CREATE SEQUENCE', 'CREATE STOGROUP', 'CREATE SYNONYM', 'CREATE TABLE', 'CREATE TABLESPACE', 'CREATE TRIGGER', 'CREATE TRUSTED CONTEXT', 'CREATE TYPE', 'CREATE VARIABLE', 'CREATE VIEW', 'DECLARE CURSOR', 'DECLARE GLOBAL TEMPORARY TABLE', 'DECLARE STATEMENT', 'DECLARE TABLE', 'DECLARE VARIABLE', 'DELETE', 'DELETE FROM', 'DESCRIBE CURSOR', 'DESCRIBE INPUT', 'DESCRIBE OUTPUT', 'DESCRIBE PROCEDURE', 'DESCRIBE TABLE', 'DROP', 'END DECLARE SECTION', 'EXCHANGE', 'EXECUTE', 'EXECUTE IMMEDIATE', 'EXPLAIN', 'FETCH', 'FREE LOCATOR', 'GET DIAGNOSTICS', 'GRANT', 'HOLD LOCATOR', 'INCLUDE', 'INSERT', 'LABEL', 'LOCK TABLE', 'MERGE', 'OPEN', 'PREPARE', 'REFRESH', 'RELEASE', 'RELEASE SAVEPOINT', 'RENAME', 'REVOKE', 'ROLLBACK', 'SAVEPOINT', 'SELECT', 'SELECT INTO', 'SET CONNECTION', 'SET', 'SET CURRENT ACCELERATOR', 'SET CURRENT APPLICATION COMPATIBILITY', 'SET CURRENT APPLICATION ENCODING SCHEME', 'SET CURRENT DEBUG MODE', 'SET CURRENT DECFLOAT ROUNDING MODE', 'SET CURRENT DEGREE', 'SET CURRENT EXPLAIN MODE', 'SET CURRENT GET_ACCEL_ARCHIVE', 'SET CURRENT LOCALE LC_CTYPE', 'SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION', 'SET CURRENT OPTIMIZATION HINT', 'SET CURRENT PACKAGE PATH', 'SET CURRENT PACKAGESET', 'SET CURRENT PRECISION', 'SET CURRENT QUERY ACCELERATION', 'SET CURRENT QUERY ACCELERATION WAITFORDATA', 'SET CURRENT REFRESH AGE', 'SET CURRENT ROUTINE VERSION', 'SET CURRENT RULES', 'SET CURRENT SQLID', 'SET CURRENT TEMPORAL BUSINESS_TIME', 'SET CURRENT TEMPORAL SYSTEM_TIME', 'SET ENCRYPTION PASSWORD', 'SET PATH', 'SET SCHEMA', 'SET SESSION TIME ZONE', 'SIGNAL', 'TRUNCATE', 'UPDATE', 'VALUES', 'VALUES INTO', 'WHENEVER', // other | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'ORDER BY [INPUT SEQUENCE]', 'FETCH FIRST', // https://www.ibm.com/docs/en/db2-for-zos/11?topic=statements-list-supported | ||
'ALLOCATE CURSOR', 'ALTER DATABASE', 'ALTER FUNCTION', 'ALTER INDEX', 'ALTER MASK', 'ALTER PERMISSION', 'ALTER PROCEDURE', 'ALTER SEQUENCE', 'ALTER STOGROUP', 'ALTER TABLE', 'ALTER TABLESPACE', 'ALTER TRIGGER', 'ALTER TRUSTED CONTEXT', 'ALTER VIEW', 'ASSOCIATE LOCATORS', 'BEGIN DECLARE SECTION', 'CALL', 'CLOSE', 'COMMENT', 'COMMIT', 'CONNECT', 'CREATE ALIAS', 'CREATE AUXILIARY TABLE', 'CREATE DATABASE', 'CREATE FUNCTION', 'CREATE GLOBAL TEMPORARY TABLE', 'CREATE INDEX', 'CREATE LOB TABLESPACE', 'CREATE MASK', 'CREATE PERMISSION', 'CREATE PROCEDURE', 'CREATE ROLE', 'CREATE SEQUENCE', 'CREATE STOGROUP', 'CREATE SYNONYM', 'CREATE TABLE', 'CREATE TABLESPACE', 'CREATE TRIGGER', 'CREATE TRUSTED CONTEXT', 'CREATE TYPE', 'CREATE VARIABLE', 'CREATE VIEW', 'DECLARE CURSOR', 'DECLARE GLOBAL TEMPORARY TABLE', 'DECLARE STATEMENT', 'DECLARE TABLE', 'DECLARE VARIABLE', 'DELETE', 'DELETE FROM', 'DESCRIBE CURSOR', 'DESCRIBE INPUT', 'DESCRIBE OUTPUT', 'DESCRIBE PROCEDURE', 'DESCRIBE TABLE', 'DROP', 'END DECLARE SECTION', 'EXCHANGE', 'EXECUTE', 'EXECUTE IMMEDIATE', 'EXPLAIN', 'FETCH', 'FREE LOCATOR', 'GET DIAGNOSTICS', 'GRANT', 'HOLD LOCATOR', 'INCLUDE', 'INSERT', 'LABEL', 'LOCK TABLE', 'MERGE', 'OPEN', 'PREPARE', 'REFRESH', 'RELEASE', 'RELEASE SAVEPOINT', 'RENAME', 'REVOKE', 'ROLLBACK', 'SAVEPOINT', 'SELECT INTO', 'SET CONNECTION', 'SET', 'SET CURRENT ACCELERATOR', 'SET CURRENT APPLICATION COMPATIBILITY', 'SET CURRENT APPLICATION ENCODING SCHEME', 'SET CURRENT DEBUG MODE', 'SET CURRENT DECFLOAT ROUNDING MODE', 'SET CURRENT DEGREE', 'SET CURRENT EXPLAIN MODE', 'SET CURRENT GET_ACCEL_ARCHIVE', 'SET CURRENT LOCALE LC_CTYPE', 'SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION', 'SET CURRENT OPTIMIZATION HINT', 'SET CURRENT PACKAGE PATH', 'SET CURRENT PACKAGESET', 'SET CURRENT PRECISION', 'SET CURRENT QUERY ACCELERATION', 'SET CURRENT QUERY ACCELERATION WAITFORDATA', 'SET CURRENT REFRESH AGE', 'SET CURRENT ROUTINE VERSION', 'SET CURRENT RULES', 'SET CURRENT SQLID', 'SET CURRENT TEMPORAL BUSINESS_TIME', 'SET CURRENT TEMPORAL SYSTEM_TIME', 'SET ENCRYPTION PASSWORD', 'SET PATH', 'SET SCHEMA', 'SET SESSION TIME ZONE', 'SIGNAL', 'TRUNCATE', 'UPDATE', 'VALUES', 'VALUES INTO', 'WHENEVER', // other | ||
'ADD', 'ALTER COLUMN', // verify | ||
'AFTER', 'DROP TABLE', // verify | ||
'FETCH FIRST', 'FROM', 'GROUP BY', 'GO', 'HAVING', 'INSERT INTO', 'LIMIT', 'OFFSET', 'ORDER BY', 'SELECT', 'SET CURRENT SCHEMA', 'WHERE', 'WITH']; | ||
'GO', 'INSERT INTO', 'SET CURRENT SCHEMA']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL]', 'EXCEPT [ALL]', 'INTERSECT [ALL]']); | ||
@@ -51,0 +52,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN']); // https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/db2/rbafzintro.htm |
@@ -44,3 +44,4 @@ "use strict"; | ||
var reservedCommands = [// commands | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'SORT BY', 'CLUSTER BY', 'DISTRIBUTE BY', 'LIMIT', // other | ||
'ALTER', 'ALTER COLUMN', // added | ||
@@ -50,6 +51,6 @@ 'ALTER TABLE', // added | ||
'USE', 'DESCRIBE', 'DROP', 'DROP TABLE', // added | ||
'FETCH', 'FROM', 'GROUP BY', 'HAVING', 'INSERT', 'INSERT INTO', // added | ||
'LIMIT', 'OFFSET', 'ORDER BY', 'SELECT', 'SET', 'SET SCHEMA', // added | ||
'SHOW', 'SORT BY', 'TRUNCATE', 'UPDATE', 'VALUES', 'WHERE', 'WITH', 'WINDOW', 'PARTITION BY', // newline keywords | ||
'STORED AS', 'STORED BY', 'ROW FORMAT']; | ||
'FETCH', 'INSERT', 'INSERT INTO', // added | ||
'SET', 'SET SCHEMA', // added | ||
'SHOW', 'TRUNCATE', 'UPDATE', 'VALUES', // newline keywords | ||
'STORED AS', 'STORED BY', 'ROW FORMAT']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL | DISTINCT]']); | ||
@@ -56,0 +57,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', // non-standard joins |
@@ -50,5 +50,6 @@ "use strict"; | ||
// https://mariadb.com/docs/reference/mdb/sql-statements/ | ||
var reservedCommands = ['ALTER DATABASE', 'ALTER DATABASE COMMENT', 'ALTER EVENT', 'ALTER FUNCTION', 'ALTER PROCEDURE', 'ALTER SCHEMA', 'ALTER SCHEMA COMMENT', 'ALTER SEQUENCE', 'ALTER SERVER', 'ALTER TABLE', 'ALTER USER', 'ALTER VIEW', 'ANALYZE', 'ANALYZE TABLE', 'BACKUP LOCK', 'BACKUP STAGE', 'BACKUP UNLOCK', 'BEGIN', 'BINLOG', 'CACHE INDEX', 'CALL', 'CHANGE MASTER TO', 'CHECK TABLE', 'CHECK VIEW', 'CHECKSUM TABLE', 'COMMIT', 'CREATE AGGREGATE FUNCTION', 'CREATE DATABASE', 'CREATE EVENT', 'CREATE FUNCTION', 'CREATE INDEX', 'CREATE PROCEDURE', 'CREATE ROLE', 'CREATE SEQUENCE', 'CREATE SERVER', 'CREATE SPATIAL INDEX', 'CREATE TABLE', 'CREATE TRIGGER', 'CREATE UNIQUE INDEX', 'CREATE USER', 'CREATE VIEW', 'DEALLOCATE PREPARE', 'DELETE', 'DELETE FROM', 'DESCRIBE', 'DO', 'DROP DATABASE', 'DROP EVENT', 'DROP FUNCTION', 'DROP INDEX', 'DROP PREPARE', 'DROP PROCEDURE', 'DROP ROLE', 'DROP SEQUENCE', 'DROP SERVER', 'DROP TABLE', 'DROP TRIGGER', 'DROP USER', 'DROP VIEW', 'EXECUTE', 'EXPLAIN', 'FLUSH', 'GET DIAGNOSTICS', 'GET DIAGNOSTICS CONDITION', 'GRANT', 'HANDLER', 'HELP', 'INSERT', 'INSTALL PLUGIN', 'INSTALL SONAME', 'KILL', 'LOAD DATA INFILE', 'LOAD INDEX INTO CACHE', 'LOAD XML INFILE', 'LOCK TABLE', 'OPTIMIZE TABLE', 'PREPARE', 'PURGE BINARY LOGS', 'PURGE MASTER LOGS', 'RELEASE SAVEPOINT', 'RENAME TABLE', 'RENAME USER', 'REPAIR TABLE', 'REPAIR VIEW', 'REPLACE', 'RESET MASTER', 'RESET QUERY CACHE', 'RESET REPLICA', 'RESET SLAVE', 'RESIGNAL', 'RETURNING', 'REVOKE', 'ROLLBACK', 'SAVEPOINT', 'SELECT', 'SET', 'SET CHARACTER SET', 'SET DEFAULT ROLE', 'SET GLOBAL TRANSACTION', 'SET NAMES', 'SET PASSWORD', 'SET ROLE', 'SET STATEMENT', 'SET TRANSACTION', 'SHOW', 'SHOW ALL REPLICAS STATUS', 'SHOW ALL SLAVES STATUS', 'SHOW AUTHORS', 'SHOW BINARY LOGS', 'SHOW BINLOG EVENTS', 'SHOW BINLOG STATUS', 'SHOW CHARACTER SET', 'SHOW CLIENT_STATISTICS', 'SHOW COLLATION', 'SHOW COLUMNS', 'SHOW CONTRIBUTORS', 'SHOW CREATE DATABASE', 'SHOW CREATE EVENT', 'SHOW CREATE FUNCTION', 'SHOW CREATE PACKAGE', 'SHOW CREATE PACKAGE BODY', 'SHOW CREATE PROCEDURE', 'SHOW CREATE SEQUENCE', 'SHOW CREATE TABLE', 'SHOW CREATE TRIGGER', 'SHOW CREATE USER', 'SHOW CREATE VIEW', 'SHOW DATABASES', 'SHOW ENGINE', 'SHOW ENGINE INNODB STATUS', 'SHOW ENGINES', 'SHOW ERRORS', 'SHOW EVENTS', 'SHOW EXPLAIN', 'SHOW FUNCTION CODE', 'SHOW FUNCTION STATUS', 'SHOW GRANTS', 'SHOW INDEX', 'SHOW INDEXES', 'SHOW INDEX_STATISTICS', 'SHOW KEYS', 'SHOW LOCALES', 'SHOW MASTER LOGS', 'SHOW MASTER STATUS', 'SHOW OPEN TABLES', 'SHOW PACKAGE BODY CODE', 'SHOW PACKAGE BODY STATUS', 'SHOW PACKAGE STATUS', 'SHOW PLUGINS', 'SHOW PLUGINS SONAME', 'SHOW PRIVILEGES', 'SHOW PROCEDURE CODE', 'SHOW PROCEDURE STATUS', 'SHOW PROCESSLIST', 'SHOW PROFILE', 'SHOW PROFILES', 'SHOW QUERY_RESPONSE_TIME', 'SHOW RELAYLOG EVENTS', 'SHOW REPLICA', 'SHOW REPLICA HOSTS', 'SHOW REPLICA STATUS', 'SHOW SCHEMAS', 'SHOW SLAVE', 'SHOW SLAVE HOSTS', 'SHOW SLAVE STATUS', 'SHOW STATUS', 'SHOW STORAGE ENGINES', 'SHOW TABLE STATUS', 'SHOW TABLES', 'SHOW TRIGGERS', 'SHOW USER_STATISTICS', 'SHOW VARIABLES', 'SHOW WARNINGS', 'SHOW WSREP_MEMBERSHIP', 'SHOW WSREP_STATUS', 'SHUTDOWN', 'SIGNAL', 'START ALL REPLICAS', 'START ALL SLAVES', 'START REPLICA', 'START SLAVE', 'START TRANSACTION', 'STOP ALL REPLICAS', 'STOP ALL SLAVES', 'STOP REPLICA', 'STOP SLAVE', 'TRUNCATE', 'TRUNCATE TABLE', 'UNINSTALL PLUGIN', 'UNINSTALL SONAME', 'UNLOCK TABLE', 'UPDATE', 'USE', 'WITH', 'XA BEGIN', 'XA COMMIT', 'XA END', 'XA PREPARE', 'XA RECOVER', 'XA ROLLBACK', 'XA START', // other | ||
'ADD', 'ALTER COLUMN', 'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', 'INSERT', 'LIMIT', 'OFFSET', 'ORDER BY', 'SELECT', 'VALUES', 'WHERE']; | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT | DISTINCTROW]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'ORDER BY', 'LIMIT', 'OFFSET', 'FETCH {FIRST | NEXT}', // https://mariadb.com/docs/reference/mdb/sql-statements/ | ||
'ALTER DATABASE', 'ALTER DATABASE COMMENT', 'ALTER EVENT', 'ALTER FUNCTION', 'ALTER PROCEDURE', 'ALTER SCHEMA', 'ALTER SCHEMA COMMENT', 'ALTER SEQUENCE', 'ALTER SERVER', 'ALTER TABLE', 'ALTER USER', 'ALTER VIEW', 'ANALYZE', 'ANALYZE TABLE', 'BACKUP LOCK', 'BACKUP STAGE', 'BACKUP UNLOCK', 'BEGIN', 'BINLOG', 'CACHE INDEX', 'CALL', 'CHANGE MASTER TO', 'CHECK TABLE', 'CHECK VIEW', 'CHECKSUM TABLE', 'COMMIT', 'CREATE AGGREGATE FUNCTION', 'CREATE DATABASE', 'CREATE EVENT', 'CREATE FUNCTION', 'CREATE INDEX', 'CREATE PROCEDURE', 'CREATE ROLE', 'CREATE SEQUENCE', 'CREATE SERVER', 'CREATE SPATIAL INDEX', 'CREATE TABLE', 'CREATE TRIGGER', 'CREATE UNIQUE INDEX', 'CREATE USER', 'CREATE VIEW', 'DEALLOCATE PREPARE', 'DELETE', 'DELETE FROM', 'DESCRIBE', 'DO', 'DROP DATABASE', 'DROP EVENT', 'DROP FUNCTION', 'DROP INDEX', 'DROP PREPARE', 'DROP PROCEDURE', 'DROP ROLE', 'DROP SEQUENCE', 'DROP SERVER', 'DROP TABLE', 'DROP TRIGGER', 'DROP USER', 'DROP VIEW', 'EXECUTE', 'EXPLAIN', 'FLUSH', 'GET DIAGNOSTICS', 'GET DIAGNOSTICS CONDITION', 'GRANT', 'HANDLER', 'HELP', 'INSERT', 'INSTALL PLUGIN', 'INSTALL SONAME', 'KILL', 'LOAD DATA INFILE', 'LOAD INDEX INTO CACHE', 'LOAD XML INFILE', 'LOCK TABLE', 'OPTIMIZE TABLE', 'PREPARE', 'PURGE BINARY LOGS', 'PURGE MASTER LOGS', 'RELEASE SAVEPOINT', 'RENAME TABLE', 'RENAME USER', 'REPAIR TABLE', 'REPAIR VIEW', 'REPLACE', 'RESET MASTER', 'RESET QUERY CACHE', 'RESET REPLICA', 'RESET SLAVE', 'RESIGNAL', 'RETURNING', 'REVOKE', 'ROLLBACK', 'SAVEPOINT', 'SELECT', 'SET', 'SET CHARACTER SET', 'SET DEFAULT ROLE', 'SET GLOBAL TRANSACTION', 'SET NAMES', 'SET PASSWORD', 'SET ROLE', 'SET STATEMENT', 'SET TRANSACTION', 'SHOW', 'SHOW ALL REPLICAS STATUS', 'SHOW ALL SLAVES STATUS', 'SHOW AUTHORS', 'SHOW BINARY LOGS', 'SHOW BINLOG EVENTS', 'SHOW BINLOG STATUS', 'SHOW CHARACTER SET', 'SHOW CLIENT_STATISTICS', 'SHOW COLLATION', 'SHOW COLUMNS', 'SHOW CONTRIBUTORS', 'SHOW CREATE DATABASE', 'SHOW CREATE EVENT', 'SHOW CREATE FUNCTION', 'SHOW CREATE PACKAGE', 'SHOW CREATE PACKAGE BODY', 'SHOW CREATE PROCEDURE', 'SHOW CREATE SEQUENCE', 'SHOW CREATE TABLE', 'SHOW CREATE TRIGGER', 'SHOW CREATE USER', 'SHOW CREATE VIEW', 'SHOW DATABASES', 'SHOW ENGINE', 'SHOW ENGINE INNODB STATUS', 'SHOW ENGINES', 'SHOW ERRORS', 'SHOW EVENTS', 'SHOW EXPLAIN', 'SHOW FUNCTION CODE', 'SHOW FUNCTION STATUS', 'SHOW GRANTS', 'SHOW INDEX', 'SHOW INDEXES', 'SHOW INDEX_STATISTICS', 'SHOW KEYS', 'SHOW LOCALES', 'SHOW MASTER LOGS', 'SHOW MASTER STATUS', 'SHOW OPEN TABLES', 'SHOW PACKAGE BODY CODE', 'SHOW PACKAGE BODY STATUS', 'SHOW PACKAGE STATUS', 'SHOW PLUGINS', 'SHOW PLUGINS SONAME', 'SHOW PRIVILEGES', 'SHOW PROCEDURE CODE', 'SHOW PROCEDURE STATUS', 'SHOW PROCESSLIST', 'SHOW PROFILE', 'SHOW PROFILES', 'SHOW QUERY_RESPONSE_TIME', 'SHOW RELAYLOG EVENTS', 'SHOW REPLICA', 'SHOW REPLICA HOSTS', 'SHOW REPLICA STATUS', 'SHOW SCHEMAS', 'SHOW SLAVE', 'SHOW SLAVE HOSTS', 'SHOW SLAVE STATUS', 'SHOW STATUS', 'SHOW STORAGE ENGINES', 'SHOW TABLE STATUS', 'SHOW TABLES', 'SHOW TRIGGERS', 'SHOW USER_STATISTICS', 'SHOW VARIABLES', 'SHOW WARNINGS', 'SHOW WSREP_MEMBERSHIP', 'SHOW WSREP_STATUS', 'SHUTDOWN', 'SIGNAL', 'START ALL REPLICAS', 'START ALL SLAVES', 'START REPLICA', 'START SLAVE', 'START TRANSACTION', 'STOP ALL REPLICAS', 'STOP ALL SLAVES', 'STOP REPLICA', 'STOP SLAVE', 'TRUNCATE', 'TRUNCATE TABLE', 'UNINSTALL PLUGIN', 'UNINSTALL SONAME', 'UNLOCK TABLE', 'UPDATE', 'USE', 'XA BEGIN', 'XA COMMIT', 'XA END', 'XA PREPARE', 'XA RECOVER', 'XA ROLLBACK', 'XA START', // other | ||
'ADD', 'ALTER COLUMN', 'INSERT INTO', 'INSERT', 'VALUES']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL | DISTINCT]', 'EXCEPT [ALL | DISTINCT]', 'INTERSECT [ALL | DISTINCT]', 'MINUS [ALL | DISTINCT]']); | ||
@@ -91,3 +92,4 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL JOIN', 'NATURAL {LEFT | RIGHT} [OUTER] JOIN', // non-standard joins | ||
first: '$', | ||
rest: '$' | ||
rest: '$', | ||
allowFirstCharNumber: true | ||
}, | ||
@@ -94,0 +96,0 @@ variableTypes: [{ |
@@ -50,7 +50,8 @@ "use strict"; | ||
// https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html | ||
var reservedCommands = ['ALTER DATABASE', 'ALTER EVENT', 'ALTER FUNCTION', 'ALTER INSTANCE', 'ALTER LOGFILE GROUP', 'ALTER PROCEDURE', 'ALTER RESOURCE GROUP', 'ALTER SERVER', 'ALTER TABLE', 'ALTER TABLESPACE', 'ALTER USER', 'ALTER VIEW', 'ANALYZE TABLE', 'BINLOG', 'CACHE INDEX', 'CALL', 'CHANGE MASTER TO', 'CHANGE REPLICATION FILTER', 'CHANGE REPLICATION SOURCE TO', 'CHECK TABLE', 'CHECKSUM TABLE', 'CLONE', 'COMMIT', 'CREATE DATABASE', 'CREATE EVENT', 'CREATE FUNCTION', 'CREATE FUNCTION', 'CREATE INDEX', 'CREATE LOGFILE GROUP', 'CREATE PROCEDURE', 'CREATE RESOURCE GROUP', 'CREATE ROLE', 'CREATE SERVER', 'CREATE SPATIAL REFERENCE SYSTEM', 'CREATE TABLE', 'CREATE TABLESPACE', 'CREATE TRIGGER', 'CREATE USER', 'CREATE VIEW', 'DEALLOCATE PREPARE', 'DELETE', 'DELETE FROM', 'DESCRIBE', 'DO', 'DROP DATABASE', 'DROP EVENT', 'DROP FUNCTION', 'DROP FUNCTION', 'DROP INDEX', 'DROP LOGFILE GROUP', 'DROP PROCEDURE', 'DROP RESOURCE GROUP', 'DROP ROLE', 'DROP SERVER', 'DROP SPATIAL REFERENCE SYSTEM', 'DROP TABLE', 'DROP TABLESPACE', 'DROP TRIGGER', 'DROP USER', 'DROP VIEW', 'EXECUTE', 'EXPLAIN', 'FLUSH', 'GRANT', 'HANDLER', 'HELP', 'IMPORT TABLE', 'INSERT', 'INSTALL COMPONENT', 'INSTALL PLUGIN', 'KILL', 'LOAD DATA', 'LOAD INDEX INTO CACHE', 'LOAD XML', 'LOCK INSTANCE FOR BACKUP', 'LOCK TABLES', 'MASTER_POS_WAIT', 'OPTIMIZE TABLE', 'PREPARE', 'PURGE BINARY LOGS', 'RELEASE SAVEPOINT', 'RENAME TABLE', 'RENAME USER', 'REPAIR TABLE', 'REPLACE', 'RESET', 'RESET MASTER', 'RESET PERSIST', 'RESET REPLICA', 'RESET SLAVE', 'RESTART', 'REVOKE', 'ROLLBACK', 'ROLLBACK TO SAVEPOINT', 'SAVEPOINT', 'SELECT', 'SET', 'SET CHARACTER SET', 'SET DEFAULT ROLE', 'SET NAMES', 'SET PASSWORD', 'SET RESOURCE GROUP', 'SET ROLE', 'SET TRANSACTION', 'SHOW', 'SHOW BINARY LOGS', 'SHOW BINLOG EVENTS', 'SHOW CHARACTER SET', 'SHOW COLLATION', 'SHOW COLUMNS', 'SHOW CREATE DATABASE', 'SHOW CREATE EVENT', 'SHOW CREATE FUNCTION', 'SHOW CREATE PROCEDURE', 'SHOW CREATE TABLE', 'SHOW CREATE TRIGGER', 'SHOW CREATE USER', 'SHOW CREATE VIEW', 'SHOW DATABASES', 'SHOW ENGINE', 'SHOW ENGINES', 'SHOW ERRORS', 'SHOW EVENTS', 'SHOW FUNCTION CODE', 'SHOW FUNCTION STATUS', 'SHOW GRANTS', 'SHOW INDEX', 'SHOW MASTER STATUS', 'SHOW OPEN TABLES', 'SHOW PLUGINS', 'SHOW PRIVILEGES', 'SHOW PROCEDURE CODE', 'SHOW PROCEDURE STATUS', 'SHOW PROCESSLIST', 'SHOW PROFILE', 'SHOW PROFILES', 'SHOW RELAYLOG EVENTS', 'SHOW REPLICA STATUS', 'SHOW REPLICAS', 'SHOW SLAVE', 'SHOW SLAVE HOSTS', 'SHOW STATUS', 'SHOW TABLE STATUS', 'SHOW TABLES', 'SHOW TRIGGERS', 'SHOW VARIABLES', 'SHOW WARNINGS', 'SHUTDOWN', 'SOURCE_POS_WAIT', 'START GROUP_REPLICATION', 'START REPLICA', 'START SLAVE', 'START TRANSACTION', 'STOP GROUP_REPLICATION', 'STOP REPLICA', 'STOP SLAVE', 'TABLE', 'TRUNCATE TABLE', 'UNINSTALL COMPONENT', 'UNINSTALL PLUGIN', 'UNLOCK INSTANCE', 'UNLOCK TABLES', 'UPDATE', 'USE', 'VALUES', 'WITH', 'XA', // flow control | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT | DISTINCTROW]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', // https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html | ||
'ALTER DATABASE', 'ALTER EVENT', 'ALTER FUNCTION', 'ALTER INSTANCE', 'ALTER LOGFILE GROUP', 'ALTER PROCEDURE', 'ALTER RESOURCE GROUP', 'ALTER SERVER', 'ALTER TABLE', 'ALTER TABLESPACE', 'ALTER USER', 'ALTER VIEW', 'ANALYZE TABLE', 'BINLOG', 'CACHE INDEX', 'CALL', 'CHANGE MASTER TO', 'CHANGE REPLICATION FILTER', 'CHANGE REPLICATION SOURCE TO', 'CHECK TABLE', 'CHECKSUM TABLE', 'CLONE', 'COMMIT', 'CREATE DATABASE', 'CREATE EVENT', 'CREATE FUNCTION', 'CREATE FUNCTION', 'CREATE INDEX', 'CREATE LOGFILE GROUP', 'CREATE PROCEDURE', 'CREATE RESOURCE GROUP', 'CREATE ROLE', 'CREATE SERVER', 'CREATE SPATIAL REFERENCE SYSTEM', 'CREATE TABLE', 'CREATE TABLESPACE', 'CREATE TRIGGER', 'CREATE USER', 'CREATE VIEW', 'DEALLOCATE PREPARE', 'DELETE', 'DELETE FROM', 'DESCRIBE', 'DO', 'DROP DATABASE', 'DROP EVENT', 'DROP FUNCTION', 'DROP FUNCTION', 'DROP INDEX', 'DROP LOGFILE GROUP', 'DROP PROCEDURE', 'DROP RESOURCE GROUP', 'DROP ROLE', 'DROP SERVER', 'DROP SPATIAL REFERENCE SYSTEM', 'DROP TABLE', 'DROP TABLESPACE', 'DROP TRIGGER', 'DROP USER', 'DROP VIEW', 'EXECUTE', 'EXPLAIN', 'FLUSH', 'GRANT', 'HANDLER', 'HELP', 'IMPORT TABLE', 'INSERT', 'INSTALL COMPONENT', 'INSTALL PLUGIN', 'KILL', 'LOAD DATA', 'LOAD INDEX INTO CACHE', 'LOAD XML', 'LOCK INSTANCE FOR BACKUP', 'LOCK TABLES', 'MASTER_POS_WAIT', 'OPTIMIZE TABLE', 'PREPARE', 'PURGE BINARY LOGS', 'RELEASE SAVEPOINT', 'RENAME TABLE', 'RENAME USER', 'REPAIR TABLE', 'REPLACE', 'RESET', 'RESET MASTER', 'RESET PERSIST', 'RESET REPLICA', 'RESET SLAVE', 'RESTART', 'REVOKE', 'ROLLBACK', 'ROLLBACK TO SAVEPOINT', 'SAVEPOINT', 'SET', 'SET CHARACTER SET', 'SET DEFAULT ROLE', 'SET NAMES', 'SET PASSWORD', 'SET RESOURCE GROUP', 'SET ROLE', 'SET TRANSACTION', 'SHOW', 'SHOW BINARY LOGS', 'SHOW BINLOG EVENTS', 'SHOW CHARACTER SET', 'SHOW COLLATION', 'SHOW COLUMNS', 'SHOW CREATE DATABASE', 'SHOW CREATE EVENT', 'SHOW CREATE FUNCTION', 'SHOW CREATE PROCEDURE', 'SHOW CREATE TABLE', 'SHOW CREATE TRIGGER', 'SHOW CREATE USER', 'SHOW CREATE VIEW', 'SHOW DATABASES', 'SHOW ENGINE', 'SHOW ENGINES', 'SHOW ERRORS', 'SHOW EVENTS', 'SHOW FUNCTION CODE', 'SHOW FUNCTION STATUS', 'SHOW GRANTS', 'SHOW INDEX', 'SHOW MASTER STATUS', 'SHOW OPEN TABLES', 'SHOW PLUGINS', 'SHOW PRIVILEGES', 'SHOW PROCEDURE CODE', 'SHOW PROCEDURE STATUS', 'SHOW PROCESSLIST', 'SHOW PROFILE', 'SHOW PROFILES', 'SHOW RELAYLOG EVENTS', 'SHOW REPLICA STATUS', 'SHOW REPLICAS', 'SHOW SLAVE', 'SHOW SLAVE HOSTS', 'SHOW STATUS', 'SHOW TABLE STATUS', 'SHOW TABLES', 'SHOW TRIGGERS', 'SHOW VARIABLES', 'SHOW WARNINGS', 'SHUTDOWN', 'SOURCE_POS_WAIT', 'START GROUP_REPLICATION', 'START REPLICA', 'START SLAVE', 'START TRANSACTION', 'STOP GROUP_REPLICATION', 'STOP REPLICA', 'STOP SLAVE', 'TABLE', 'TRUNCATE TABLE', 'UNINSTALL COMPONENT', 'UNINSTALL PLUGIN', 'UNLOCK INSTANCE', 'UNLOCK TABLES', 'UPDATE', 'USE', 'VALUES', 'XA', // flow control | ||
// 'IF', | ||
'ITERATE', 'LEAVE', 'LOOP', 'REPEAT', 'RETURN', 'WHILE', // other | ||
'ADD', 'ALTER COLUMN', 'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', 'LIMIT', 'OFFSET', 'ORDER BY', 'WHERE', 'WINDOW', 'PARTITION BY']; | ||
'ADD', 'ALTER COLUMN', 'INSERT INTO']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL | DISTINCT]']); | ||
@@ -93,3 +94,4 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL [INNER] JOIN', 'NATURAL {LEFT | RIGHT} [OUTER] JOIN', // non-standard joins | ||
first: '$', | ||
rest: '$' | ||
rest: '$', | ||
allowFirstCharNumber: true | ||
}, | ||
@@ -96,0 +98,0 @@ variableTypes: [{ |
@@ -44,7 +44,8 @@ "use strict"; | ||
// https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html | ||
var reservedCommands = ['ADVISE', 'ALTER INDEX', 'BEGIN TRANSACTION', 'BUILD INDEX', 'COMMIT TRANSACTION', 'CREATE COLLECTION', 'CREATE FUNCTION', 'CREATE INDEX', 'CREATE PRIMARY INDEX', 'CREATE SCOPE', 'CREATE TABLE', // verify | ||
'DELETE', 'DELETE FROM', 'DROP COLLECTION', 'DROP FUNCTION', 'DROP INDEX', 'DROP PRIMARY INDEX', 'DROP SCOPE', 'EXECUTE', 'EXECUTE FUNCTION', 'EXPLAIN', 'GRANT', 'INFER', 'INSERT', 'MERGE', 'PREPARE', 'RETURNING', 'REVOKE', 'ROLLBACK TRANSACTION', 'SAVEPOINT', 'SELECT', 'SET TRANSACTION', 'UPDATE', 'UPDATE STATISTICS', 'UPSERT', // other | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', // https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html | ||
'ADVISE', 'ALTER INDEX', 'BEGIN TRANSACTION', 'BUILD INDEX', 'COMMIT TRANSACTION', 'CREATE COLLECTION', 'CREATE FUNCTION', 'CREATE INDEX', 'CREATE PRIMARY INDEX', 'CREATE SCOPE', 'CREATE TABLE', // verify | ||
'DELETE', 'DELETE FROM', 'DROP COLLECTION', 'DROP FUNCTION', 'DROP INDEX', 'DROP PRIMARY INDEX', 'DROP SCOPE', 'EXECUTE', 'EXECUTE FUNCTION', 'EXPLAIN', 'GRANT', 'INFER', 'INSERT', 'MERGE', 'PREPARE', 'RETURNING', 'REVOKE', 'ROLLBACK TRANSACTION', 'SAVEPOINT', 'SET TRANSACTION', 'UPDATE', 'UPDATE STATISTICS', 'UPSERT', // other | ||
'DROP TABLE', // verify, | ||
'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', 'LET', 'LIMIT', 'OFFSET', 'NEST', 'ORDER BY', 'SET CURRENT SCHEMA', 'SET SCHEMA', 'SET', 'SHOW', 'UNNEST', 'USE KEYS', 'VALUES', 'WHERE', 'WITH', 'WINDOW', 'PARTITION BY']; | ||
'INSERT INTO', 'LET', 'NEST', 'SET CURRENT SCHEMA', 'SET SCHEMA', 'SET', 'SHOW', 'UNNEST', 'USE KEYS', 'VALUES']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL]', 'EXCEPT [ALL]', 'INTERSECT [ALL]']); | ||
@@ -51,0 +52,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT} [OUTER] JOIN', 'INNER JOIN']); // For reference: http://docs.couchbase.com.s3-website-us-west-1.amazonaws.com/server/6.0/n1ql/n1ql-language-reference/index.html |
@@ -50,5 +50,7 @@ "use strict"; | ||
var reservedCommands = ['ADD', 'ALTER COLUMN', 'ALTER TABLE', 'BEGIN', 'CONNECT BY', 'CREATE TABLE', // verify | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH', 'SELECT [ALL | DISTINCT | UNIQUE]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'ORDER [SIBLINGS] BY', 'OFFSET', 'FETCH {FIRST | NEXT}', // other | ||
'ADD', 'ALTER COLUMN', 'ALTER TABLE', 'BEGIN', 'CONNECT BY', 'CREATE TABLE', // verify | ||
'DROP TABLE', // verify | ||
'DECLARE', 'DELETE', 'DELETE FROM', 'EXCEPT', 'EXCEPTION', 'FETCH FIRST', 'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', 'INSERT', 'LIMIT', 'OFFSET', 'LOOP', 'MODIFY', 'ORDER BY', 'RETURNING', 'SELECT', 'SET CURRENT SCHEMA', 'SET SCHEMA', 'SET', 'START WITH', 'UPDATE', 'VALUES', 'WHERE', 'WITH']; | ||
'DECLARE', 'DELETE', 'DELETE FROM', 'EXCEPT', 'EXCEPTION', 'INSERT INTO', 'INSERT', 'LOOP', 'MODIFY', 'RETURNING', 'SET CURRENT SCHEMA', 'SET SCHEMA', 'SET', 'START WITH', 'UPDATE', 'VALUES']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL]', 'EXCEPT', 'INTERSECT']); | ||
@@ -55,0 +57,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL [INNER] JOIN', 'NATURAL {LEFT | RIGHT | FULL} [OUTER] JOIN', // non-standard joins |
@@ -44,7 +44,8 @@ "use strict"; | ||
// https://www.postgresql.org/docs/14/sql-commands.html | ||
var reservedCommands = ['ABORT', 'ALTER AGGREGATE', 'ALTER COLLATION', 'ALTER CONVERSION', 'ALTER DATABASE', 'ALTER DEFAULT PRIVILEGES', 'ALTER DOMAIN', 'ALTER EVENT TRIGGER', 'ALTER EXTENSION', 'ALTER FOREIGN DATA WRAPPER', 'ALTER FOREIGN TABLE', 'ALTER FUNCTION', 'ALTER GROUP', 'ALTER INDEX', 'ALTER LANGUAGE', 'ALTER LARGE OBJECT', 'ALTER MATERIALIZED VIEW', 'ALTER OPERATOR', 'ALTER OPERATOR CLASS', 'ALTER OPERATOR FAMILY', 'ALTER POLICY', 'ALTER PROCEDURE', 'ALTER PUBLICATION', 'ALTER ROLE', 'ALTER ROUTINE', 'ALTER RULE', 'ALTER SCHEMA', 'ALTER SEQUENCE', 'ALTER SERVER', 'ALTER STATISTICS', 'ALTER SUBSCRIPTION', 'ALTER SYSTEM', 'ALTER TABLE', 'ALTER TABLESPACE', 'ALTER TEXT SEARCH CONFIGURATION', 'ALTER TEXT SEARCH DICTIONARY', 'ALTER TEXT SEARCH PARSER', 'ALTER TEXT SEARCH TEMPLATE', 'ALTER TRIGGER', 'ALTER TYPE', 'ALTER USER', 'ALTER USER MAPPING', 'ALTER VIEW', 'ANALYZE', 'BEGIN', 'CALL', 'CHECKPOINT', 'CLOSE', 'CLUSTER', 'COMMENT', 'COMMIT', 'COMMIT PREPARED', 'COPY', 'CREATE ACCESS METHOD', 'CREATE AGGREGATE', 'CREATE CAST', 'CREATE COLLATION', 'CREATE CONVERSION', 'CREATE DATABASE', 'CREATE DOMAIN', 'CREATE EVENT TRIGGER', 'CREATE EXTENSION', 'CREATE FOREIGN DATA WRAPPER', 'CREATE FOREIGN TABLE', 'CREATE FUNCTION', 'CREATE GROUP', 'CREATE INDEX', 'CREATE LANGUAGE', 'CREATE MATERIALIZED VIEW', 'CREATE OPERATOR', 'CREATE OPERATOR CLASS', 'CREATE OPERATOR FAMILY', 'CREATE POLICY', 'CREATE PROCEDURE', 'CREATE PUBLICATION', 'CREATE ROLE', 'CREATE RULE', 'CREATE SCHEMA', 'CREATE SEQUENCE', 'CREATE SERVER', 'CREATE STATISTICS', 'CREATE SUBSCRIPTION', 'CREATE TABLE', 'CREATE TABLE AS', 'CREATE TABLESPACE', 'CREATE TEXT SEARCH CONFIGURATION', 'CREATE TEXT SEARCH DICTIONARY', 'CREATE TEXT SEARCH PARSER', 'CREATE TEXT SEARCH TEMPLATE', 'CREATE TRANSFORM', 'CREATE TRIGGER', 'CREATE TYPE', 'CREATE USER', 'CREATE USER MAPPING', 'CREATE VIEW', 'DEALLOCATE', 'DECLARE', 'DELETE', 'DELETE FROM', 'DISCARD', 'DO', 'DROP ACCESS METHOD', 'DROP AGGREGATE', 'DROP CAST', 'DROP COLLATION', 'DROP CONVERSION', 'DROP DATABASE', 'DROP DOMAIN', 'DROP EVENT TRIGGER', 'DROP EXTENSION', 'DROP FOREIGN DATA WRAPPER', 'DROP FOREIGN TABLE', 'DROP FUNCTION', 'DROP GROUP', 'DROP INDEX', 'DROP LANGUAGE', 'DROP MATERIALIZED VIEW', 'DROP OPERATOR', 'DROP OPERATOR CLASS', 'DROP OPERATOR FAMILY', 'DROP OWNED', 'DROP POLICY', 'DROP PROCEDURE', 'DROP PUBLICATION', 'DROP ROLE', 'DROP ROUTINE', 'DROP RULE', 'DROP SCHEMA', 'DROP SEQUENCE', 'DROP SERVER', 'DROP STATISTICS', 'DROP SUBSCRIPTION', 'DROP TABLE', 'DROP TABLESPACE', 'DROP TEXT SEARCH CONFIGURATION', 'DROP TEXT SEARCH DICTIONARY', 'DROP TEXT SEARCH PARSER', 'DROP TEXT SEARCH TEMPLATE', 'DROP TRANSFORM', 'DROP TRIGGER', 'DROP TYPE', 'DROP USER', 'DROP USER MAPPING', 'DROP VIEW', 'EXECUTE', 'EXPLAIN', 'FETCH', 'GRANT', 'IMPORT FOREIGN SCHEMA', 'INSERT', 'LISTEN', 'LOAD', 'LOCK', 'MOVE', 'NOTIFY', 'PREPARE', 'PREPARE TRANSACTION', 'REASSIGN OWNED', 'REFRESH MATERIALIZED VIEW', 'REINDEX', 'RELEASE SAVEPOINT', 'RESET', 'RETURNING', 'REVOKE', 'ROLLBACK', 'ROLLBACK PREPARED', 'ROLLBACK TO SAVEPOINT', 'SAVEPOINT', 'SECURITY LABEL', 'SELECT', 'SELECT INTO', 'SET', 'SET CONSTRAINTS', 'SET ROLE', 'SET SESSION AUTHORIZATION', 'SET TRANSACTION', 'SHOW', 'START TRANSACTION', 'TRUNCATE', 'UNLISTEN', 'UPDATE', 'VACUUM', 'VALUES', // other | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY [ALL | DISTINCT]', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'FETCH {FIRST | NEXT}', // https://www.postgresql.org/docs/14/sql-commands.html | ||
'ABORT', 'ALTER AGGREGATE', 'ALTER COLLATION', 'ALTER CONVERSION', 'ALTER DATABASE', 'ALTER DEFAULT PRIVILEGES', 'ALTER DOMAIN', 'ALTER EVENT TRIGGER', 'ALTER EXTENSION', 'ALTER FOREIGN DATA WRAPPER', 'ALTER FOREIGN TABLE', 'ALTER FUNCTION', 'ALTER GROUP', 'ALTER INDEX', 'ALTER LANGUAGE', 'ALTER LARGE OBJECT', 'ALTER MATERIALIZED VIEW', 'ALTER OPERATOR', 'ALTER OPERATOR CLASS', 'ALTER OPERATOR FAMILY', 'ALTER POLICY', 'ALTER PROCEDURE', 'ALTER PUBLICATION', 'ALTER ROLE', 'ALTER ROUTINE', 'ALTER RULE', 'ALTER SCHEMA', 'ALTER SEQUENCE', 'ALTER SERVER', 'ALTER STATISTICS', 'ALTER SUBSCRIPTION', 'ALTER SYSTEM', 'ALTER TABLE', 'ALTER TABLESPACE', 'ALTER TEXT SEARCH CONFIGURATION', 'ALTER TEXT SEARCH DICTIONARY', 'ALTER TEXT SEARCH PARSER', 'ALTER TEXT SEARCH TEMPLATE', 'ALTER TRIGGER', 'ALTER TYPE', 'ALTER USER', 'ALTER USER MAPPING', 'ALTER VIEW', 'ANALYZE', 'BEGIN', 'CALL', 'CHECKPOINT', 'CLOSE', 'CLUSTER', 'COMMENT', 'COMMIT', 'COMMIT PREPARED', 'COPY', 'CREATE ACCESS METHOD', 'CREATE AGGREGATE', 'CREATE CAST', 'CREATE COLLATION', 'CREATE CONVERSION', 'CREATE DATABASE', 'CREATE DOMAIN', 'CREATE EVENT TRIGGER', 'CREATE EXTENSION', 'CREATE FOREIGN DATA WRAPPER', 'CREATE FOREIGN TABLE', 'CREATE FUNCTION', 'CREATE GROUP', 'CREATE INDEX', 'CREATE LANGUAGE', 'CREATE MATERIALIZED VIEW', 'CREATE OPERATOR', 'CREATE OPERATOR CLASS', 'CREATE OPERATOR FAMILY', 'CREATE POLICY', 'CREATE PROCEDURE', 'CREATE PUBLICATION', 'CREATE ROLE', 'CREATE RULE', 'CREATE SCHEMA', 'CREATE SEQUENCE', 'CREATE SERVER', 'CREATE STATISTICS', 'CREATE SUBSCRIPTION', 'CREATE TABLE', 'CREATE TABLE AS', 'CREATE TABLESPACE', 'CREATE TEXT SEARCH CONFIGURATION', 'CREATE TEXT SEARCH DICTIONARY', 'CREATE TEXT SEARCH PARSER', 'CREATE TEXT SEARCH TEMPLATE', 'CREATE TRANSFORM', 'CREATE TRIGGER', 'CREATE TYPE', 'CREATE USER', 'CREATE USER MAPPING', 'CREATE VIEW', 'DEALLOCATE', 'DECLARE', 'DELETE', 'DELETE FROM', 'DISCARD', 'DO', 'DROP ACCESS METHOD', 'DROP AGGREGATE', 'DROP CAST', 'DROP COLLATION', 'DROP CONVERSION', 'DROP DATABASE', 'DROP DOMAIN', 'DROP EVENT TRIGGER', 'DROP EXTENSION', 'DROP FOREIGN DATA WRAPPER', 'DROP FOREIGN TABLE', 'DROP FUNCTION', 'DROP GROUP', 'DROP INDEX', 'DROP LANGUAGE', 'DROP MATERIALIZED VIEW', 'DROP OPERATOR', 'DROP OPERATOR CLASS', 'DROP OPERATOR FAMILY', 'DROP OWNED', 'DROP POLICY', 'DROP PROCEDURE', 'DROP PUBLICATION', 'DROP ROLE', 'DROP ROUTINE', 'DROP RULE', 'DROP SCHEMA', 'DROP SEQUENCE', 'DROP SERVER', 'DROP STATISTICS', 'DROP SUBSCRIPTION', 'DROP TABLE', 'DROP TABLESPACE', 'DROP TEXT SEARCH CONFIGURATION', 'DROP TEXT SEARCH DICTIONARY', 'DROP TEXT SEARCH PARSER', 'DROP TEXT SEARCH TEMPLATE', 'DROP TRANSFORM', 'DROP TRIGGER', 'DROP TYPE', 'DROP USER', 'DROP USER MAPPING', 'DROP VIEW', 'EXECUTE', 'EXPLAIN', 'FETCH', 'GRANT', 'IMPORT FOREIGN SCHEMA', 'INSERT', 'LISTEN', 'LOAD', 'LOCK', 'MOVE', 'NOTIFY', 'PREPARE', 'PREPARE TRANSACTION', 'REASSIGN OWNED', 'REFRESH MATERIALIZED VIEW', 'REINDEX', 'RELEASE SAVEPOINT', 'RESET', 'RETURNING', 'REVOKE', 'ROLLBACK', 'ROLLBACK PREPARED', 'ROLLBACK TO SAVEPOINT', 'SAVEPOINT', 'SECURITY LABEL', 'SELECT INTO', 'SET', 'SET CONSTRAINTS', 'SET ROLE', 'SET SESSION AUTHORIZATION', 'SET TRANSACTION', 'SHOW', 'START TRANSACTION', 'TRUNCATE', 'UNLISTEN', 'UPDATE', 'VACUUM', 'VALUES', // other | ||
'ADD', 'AFTER', 'ALTER COLUMN', 'INSERT INTO', // verify | ||
'SET SCHEMA', // verify | ||
'FROM', 'GROUP BY', 'HAVING', 'LIMIT', 'OFFSET', 'ORDER BY', 'WHERE', 'WITH', 'WINDOW', 'PARTITION BY']; | ||
'SET SCHEMA' // verify | ||
]); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL | DISTINCT]', 'EXCEPT [ALL | DISTINCT]', 'INTERSECT [ALL | DISTINCT]']); | ||
@@ -51,0 +52,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL [INNER] JOIN', 'NATURAL {LEFT | RIGHT | FULL} [OUTER] JOIN']); |
@@ -44,9 +44,10 @@ "use strict"; | ||
// https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands.html | ||
var reservedCommands = ['ABORT', 'ALTER DATABASE', 'ALTER DATASHARE', 'ALTER DEFAULT PRIVILEGES', 'ALTER GROUP', 'ALTER MATERIALIZED VIEW', 'ALTER PROCEDURE', 'ALTER SCHEMA', 'ALTER TABLE', 'ALTER TABLE APPEND', 'ALTER USER', 'ANALYSE', 'ANALYZE', 'ANALYSE COMPRESSION', 'ANALYZE COMPRESSION', 'BEGIN', 'CALL', 'CANCEL', 'CLOSE', 'COMMENT', 'COMMIT', 'COPY', 'CREATE DATABASE', 'CREATE DATASHARE', 'CREATE EXTERNAL FUNCTION', 'CREATE EXTERNAL SCHEMA', 'CREATE EXTERNAL TABLE', 'CREATE FUNCTION', 'CREATE GROUP', 'CREATE LIBRARY', 'CREATE MATERIALIZED VIEW', 'CREATE MODEL', 'CREATE PROCEDURE', 'CREATE SCHEMA', 'CREATE TABLE', 'CREATE TABLE AS', 'CREATE USER', 'CREATE VIEW', 'DEALLOCATE', 'DECLARE', 'DELETE', 'DELETE FROM', 'DESC DATASHARE', 'DROP DATABASE', 'DROP DATASHARE', 'DROP FUNCTION', 'DROP GROUP', 'DROP LIBRARY', 'DROP MODEL', 'DROP MATERIALIZED VIEW', 'DROP PROCEDURE', 'DROP SCHEMA', 'DROP TABLE', 'DROP USER', 'DROP VIEW', 'DROP', 'EXECUTE', 'EXPLAIN', 'FETCH', 'FROM', 'GRANT', 'HAVING', 'INSERT', 'LOCK', 'PREPARE', 'REFRESH MATERIALIZED VIEW', 'RESET', 'REVOKE', 'ROLLBACK', 'SELECT', 'SELECT INTO', 'SET', 'SET SESSION AUTHORIZATION', 'SET SESSION CHARACTERISTICS', 'SHOW', 'SHOW EXTERNAL TABLE', 'SHOW MODEL', 'SHOW DATASHARES', 'SHOW PROCEDURE', 'SHOW TABLE', 'SHOW VIEW', 'START TRANSACTION', 'TRUNCATE', 'UNLOAD', 'UPDATE', 'VACUUM', 'WHERE', 'WITH', // other | ||
'GROUP BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'VALUES', 'MODIFY', // verify | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'ORDER BY', 'LIMIT', 'OFFSET', // https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands.html | ||
'ABORT', 'ALTER DATABASE', 'ALTER DATASHARE', 'ALTER DEFAULT PRIVILEGES', 'ALTER GROUP', 'ALTER MATERIALIZED VIEW', 'ALTER PROCEDURE', 'ALTER SCHEMA', 'ALTER TABLE', 'ALTER TABLE APPEND', 'ALTER USER', 'ANALYSE', 'ANALYZE', 'ANALYSE COMPRESSION', 'ANALYZE COMPRESSION', 'BEGIN', 'CALL', 'CANCEL', 'CLOSE', 'COMMENT', 'COMMIT', 'COPY', 'CREATE DATABASE', 'CREATE DATASHARE', 'CREATE EXTERNAL FUNCTION', 'CREATE EXTERNAL SCHEMA', 'CREATE EXTERNAL TABLE', 'CREATE FUNCTION', 'CREATE GROUP', 'CREATE LIBRARY', 'CREATE MATERIALIZED VIEW', 'CREATE MODEL', 'CREATE PROCEDURE', 'CREATE SCHEMA', 'CREATE TABLE', 'CREATE TABLE AS', 'CREATE USER', 'CREATE VIEW', 'DEALLOCATE', 'DECLARE', 'DELETE', 'DELETE FROM', 'DESC DATASHARE', 'DROP DATABASE', 'DROP DATASHARE', 'DROP FUNCTION', 'DROP GROUP', 'DROP LIBRARY', 'DROP MODEL', 'DROP MATERIALIZED VIEW', 'DROP PROCEDURE', 'DROP SCHEMA', 'DROP TABLE', 'DROP USER', 'DROP VIEW', 'DROP', 'EXECUTE', 'EXPLAIN', 'FETCH', 'GRANT', 'INSERT', 'LOCK', 'PREPARE', 'REFRESH MATERIALIZED VIEW', 'RESET', 'REVOKE', 'ROLLBACK', 'SELECT INTO', 'SET', 'SET SESSION AUTHORIZATION', 'SET SESSION CHARACTERISTICS', 'SHOW', 'SHOW EXTERNAL TABLE', 'SHOW MODEL', 'SHOW DATASHARES', 'SHOW PROCEDURE', 'SHOW TABLE', 'SHOW VIEW', 'START TRANSACTION', 'TRUNCATE', 'UNLOAD', 'UPDATE', 'VACUUM', 'VALUES', // other | ||
'MODIFY', // verify | ||
'INSERT INTO', // verify | ||
'ALTER COLUMN', // verify | ||
'SET SCHEMA' // verify | ||
]; | ||
]); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL]', 'EXCEPT', 'INTERSECT', 'MINUS']); | ||
@@ -78,2 +79,5 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL [INNER] JOIN', 'NATURAL {LEFT | RIGHT | FULL} [OUTER] JOIN']); // https://docs.aws.amazon.com/redshift/latest/dg/cm_chap_SQLCommandRef.html | ||
identTypes: ["\"\""], | ||
identChars: { | ||
first: '#' | ||
}, | ||
numberedParamTypes: ['$'], | ||
@@ -80,0 +84,0 @@ operators: RedshiftFormatter.operators |
@@ -51,9 +51,10 @@ "use strict"; | ||
// http://spark.apache.org/docs/latest/sql-ref-syntax.html | ||
var reservedCommands = [// DDL | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'ORDER BY', 'SORT BY', 'CLUSTER BY', 'DISTRIBUTE BY', 'LIMIT', // DDL | ||
'ALTER COLUMN', 'ALTER DATABASE', 'ALTER TABLE', 'ALTER VIEW', 'CREATE DATABASE', 'CREATE FUNCTION', 'CREATE TABLE', 'CREATE VIEW', 'DROP DATABASE', 'DROP FUNCTION', 'DROP TABLE', 'DROP VIEW', 'REPAIR TABLE', 'TRUNCATE TABLE', 'USE DATABASE', // DML | ||
'INSERT INTO', 'INSERT OVERWRITE', 'INSERT OVERWRITE DIRECTORY', 'LOAD', // Data Retrieval | ||
'SELECT', 'WITH', 'CLUSTER BY', 'DISTRIBUTE BY', 'GROUP BY', 'HAVING', 'VALUES', 'LIMIT', 'OFFSET', 'ORDER BY', 'SORT BY', 'TABLESAMPLE', 'WHERE', 'PIVOT', 'TRANSFORM', 'EXPLAIN', // Auxiliary | ||
'VALUES', 'TABLESAMPLE', 'PIVOT', 'TRANSFORM', 'EXPLAIN', // Auxiliary | ||
'ADD FILE', 'ADD JAR', 'ANALYZE TABLE', 'CACHE TABLE', 'CLEAR CACHE', 'DESCRIBE DATABASE', 'DESCRIBE FUNCTION', 'DESCRIBE QUERY', 'DESCRIBE TABLE', 'LIST FILE', 'LIST JAR', 'REFRESH', 'REFRESH TABLE', 'REFRESH FUNCTION', 'RESET', 'SET', 'SET SCHEMA', // verify | ||
'SHOW COLUMNS', 'SHOW CREATE TABLE', 'SHOW DATABASES', 'SHOW FUNCTIONS', 'SHOW PARTITIONS', 'SHOW TABLE EXTENDED', 'SHOW TABLES', 'SHOW TBLPROPERTIES', 'SHOW VIEWS', 'UNCACHE TABLE', // other | ||
'FROM', 'INSERT', 'LATERAL VIEW', 'UPDATE', 'WINDOW']; | ||
'INSERT', 'LATERAL VIEW', 'UPDATE']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL | DISTINCT]', 'EXCEPT [ALL | DISTINCT]', 'INTERSECT [ALL | DISTINCT]']); | ||
@@ -60,0 +61,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL [INNER] JOIN', 'NATURAL {LEFT | RIGHT | FULL} [OUTER] JOIN', // non-standard-joins |
@@ -44,3 +44,5 @@ "use strict"; | ||
var reservedCommands = ['ADD', 'ALTER COLUMN', 'ALTER TABLE', 'CREATE TABLE', 'DROP TABLE', 'DELETE FROM', 'FETCH FIRST', 'FETCH NEXT', 'FETCH PRIOR', 'FETCH LAST', 'FETCH ABSOLUTE', 'FETCH RELATIVE', 'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', 'LIMIT', 'OFFSET', 'ORDER BY', 'SELECT', 'SET SCHEMA', 'SET', 'UPDATE', 'VALUES', 'WHERE', 'WITH', 'WINDOW', 'PARTITION BY']; | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY [ALL | DISTINCT]', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'FETCH {FIRST | NEXT}', // other | ||
'ADD', 'ALTER COLUMN', 'ALTER TABLE', 'CREATE TABLE', 'DROP TABLE', 'DELETE FROM', 'INSERT INTO', 'SET SCHEMA', 'SET', 'UPDATE', 'VALUES']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL | DISTINCT]', 'EXCEPT [ALL | DISTINCT]', 'INTERSECT [ALL | DISTINCT]']); | ||
@@ -47,0 +49,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', 'NATURAL [INNER] JOIN', 'NATURAL {LEFT | RIGHT | FULL} [OUTER] JOIN']); |
@@ -44,3 +44,5 @@ "use strict"; | ||
var reservedCommands = ['ADD', 'ALTER COLUMN', 'ALTER TABLE', 'CREATE TABLE', 'DROP TABLE', 'DELETE', 'DELETE FROM', 'FETCH FIRST', 'FETCH NEXT', 'FETCH PRIOR', 'FETCH LAST', 'FETCH ABSOLUTE', 'FETCH RELATIVE', 'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', 'LIMIT', 'OFFSET', 'ORDER BY', 'SELECT', 'SET SCHEMA', 'SET', 'UPDATE', 'VALUES', 'WHERE', 'WITH', 'WINDOW', 'PARTITION BY']; | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', // other | ||
'ADD', 'ALTER COLUMN', 'ALTER TABLE', 'CREATE TABLE', 'DROP TABLE', 'DELETE', 'DELETE FROM', 'INSERT INTO', 'SET SCHEMA', 'SET', 'UPDATE', 'VALUES']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL]', 'EXCEPT', 'INTERSECT']); // joins - https://www.sqlite.org/syntax/join-operator.html | ||
@@ -47,0 +49,0 @@ |
@@ -45,8 +45,8 @@ "use strict"; | ||
// https://github.com/trinodb/trino/blob/432d2897bdef99388c1a47188743a061c4ac1f34/core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4#L41 | ||
var reservedCommands = [// DDL | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH [RECURSIVE]', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY [ALL | DISTINCT]', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'LIMIT', 'OFFSET', 'FETCH {FIRST | NEXT}', // DDL | ||
'ALTER SCHEMA', 'ALTER TABLE', 'RENAME TO', 'ADD COLUMN', 'RENAME COLUMN', 'DROP COLUMN', 'SET AUTHORIZATION', 'SET PROPERTIES', 'EXECUTE', 'ALTER MATERIALIZED VIEW', 'ALTER VIEW', 'CREATE SCHEMA', 'CREATE TABLE', 'CREATE VIEW', 'CREATE OR REPLACE VIEW', 'CREATE MATERIALIZED VIEW', 'CREATE OR REPLACE MATERIALIZED VIEW', 'CREATE ROLE', 'DROP SCHEMA', 'DROP TABLE', 'DROP COLUMN', 'DROP MATERIALIZED VIEW', 'DROP VIEW', 'DROP ROLE', 'TRUNCATE TABLE', // DML | ||
'INSERT INTO', 'MERGE INTO', 'VALUES', 'UPDATE', 'SET', 'DELETE FROM', // Data Retrieval | ||
'WITH', 'SELECT', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'ORDER BY', 'OFFSET', 'LIMIT', 'FETCH', 'PARTITION BY', // Auxiliary | ||
'INSERT INTO', 'MERGE INTO', 'VALUES', 'UPDATE', 'SET', 'DELETE FROM', // Auxiliary | ||
'EXPLAIN', 'ANALYZE', 'EXPLAIN ANALYZE', 'EXPLAIN ANALYZE VERBOSE', 'USE', 'COMMENT ON TABLE', 'COMMENT ON COLUMN', 'DESCRIBE INPUT', 'DESCRIBE OUTPUT', 'REFRESH MATERIALIZED VIEW', 'RESET SESSION', 'SET SESSION', 'SET PATH', 'SET TIME ZONE', 'SHOW GRANTS', 'SHOW CREATE TABLE', 'SHOW CREATE SCHEMA', 'SHOW CREATE VIEW', 'SHOW CREATE MATERIALIZED VIEW', 'SHOW TABLES', 'SHOW SCHEMAS', 'SHOW CATALOGS', 'SHOW COLUMNS', 'SHOW STATS FOR', 'SHOW ROLES', 'SHOW CURRENT ROLES', 'SHOW ROLE GRANTS', 'SHOW FUNCTIONS', 'SHOW SESSION', // MATCH_RECOGNIZE | ||
'MATCH_RECOGNIZE', 'MEASURES', 'ONE ROW PER MATCH', 'ALL ROWS PER MATCH', 'AFTER MATCH', 'PATTERN', 'SUBSET', 'DEFINE']; // https://github.com/trinodb/trino/blob/432d2897bdef99388c1a47188743a061c4ac1f34/core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4#L231-L235 | ||
'MATCH_RECOGNIZE', 'MEASURES', 'ONE ROW PER MATCH', 'ALL ROWS PER MATCH', 'AFTER MATCH', 'PATTERN', 'SUBSET', 'DEFINE']); // https://github.com/trinodb/trino/blob/432d2897bdef99388c1a47188743a061c4ac1f34/core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4#L231-L235 | ||
// https://github.com/trinodb/trino/blob/432d2897bdef99388c1a47188743a061c4ac1f34/core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4#L288-L291 | ||
@@ -53,0 +53,0 @@ |
@@ -44,8 +44,9 @@ "use strict"; | ||
// https://docs.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver15 | ||
var reservedCommands = ['ADD SENSITIVITY CLASSIFICATION', 'ADD SIGNATURE', 'AGGREGATE', 'ANSI_DEFAULTS', 'ANSI_NULLS', 'ANSI_NULL_DFLT_OFF', 'ANSI_NULL_DFLT_ON', 'ANSI_PADDING', 'ANSI_WARNINGS', 'APPLICATION ROLE', 'ARITHABORT', 'ARITHIGNORE', 'ASSEMBLY', 'ASYMMETRIC KEY', 'AUTHORIZATION', 'AVAILABILITY GROUP', 'BACKUP', 'BACKUP CERTIFICATE', 'BACKUP MASTER KEY', 'BACKUP SERVICE MASTER KEY', 'BEGIN CONVERSATION TIMER', 'BEGIN DIALOG CONVERSATION', 'BROKER PRIORITY', 'BULK INSERT', 'CERTIFICATE', 'CLOSE MASTER KEY', 'CLOSE SYMMETRIC KEY', 'COLLATE', 'COLUMN ENCRYPTION KEY', 'COLUMN MASTER KEY', 'COLUMNSTORE INDEX', 'CONCAT_NULL_YIELDS_NULL', 'CONTEXT_INFO', 'CONTRACT', 'CREDENTIAL', 'CRYPTOGRAPHIC PROVIDER', 'CURSOR_CLOSE_ON_COMMIT', 'DATABASE', 'DATABASE AUDIT SPECIFICATION', 'DATABASE ENCRYPTION KEY', 'DATABASE HADR', 'DATABASE SCOPED CONFIGURATION', 'DATABASE SCOPED CREDENTIAL', 'DATABASE SET', 'DATEFIRST', 'DATEFORMAT', 'DEADLOCK_PRIORITY', 'DEFAULT', 'DELETE', 'DELETE FROM', 'DENY', 'DENY XML', 'DISABLE TRIGGER', 'ENABLE TRIGGER', 'END CONVERSATION', 'ENDPOINT', 'EVENT NOTIFICATION', 'EVENT SESSION', 'EXECUTE AS', 'EXTERNAL DATA SOURCE', 'EXTERNAL FILE FORMAT', 'EXTERNAL LANGUAGE', 'EXTERNAL LIBRARY', 'EXTERNAL RESOURCE POOL', 'EXTERNAL TABLE', 'FIPS_FLAGGER', 'FMTONLY', 'FORCEPLAN', 'FULLTEXT CATALOG', 'FULLTEXT INDEX', 'FULLTEXT STOPLIST', 'FUNCTION', 'GET CONVERSATION GROUP', 'GET_TRANSMISSION_STATUS', 'GRANT', 'GRANT XML', 'IDENTITY_INSERT', 'IMPLICIT_TRANSACTIONS', 'INDEX', 'INSERT', 'LANGUAGE', 'LOCK_TIMEOUT', 'LOGIN', 'MASTER KEY', 'MERGE', 'MESSAGE TYPE', 'MOVE CONVERSATION', 'NOCOUNT', 'NOEXEC', 'NUMERIC_ROUNDABORT', 'OFFSETS', 'OPEN MASTER KEY', 'OPEN SYMMETRIC KEY', 'PARSEONLY', 'PARTITION FUNCTION', 'PARTITION SCHEME', 'PROCEDURE', 'QUERY_GOVERNOR_COST_LIMIT', 'QUEUE', 'QUOTED_IDENTIFIER', 'RECEIVE', 'REMOTE SERVICE BINDING', 'REMOTE_PROC_TRANSACTIONS', 'RESOURCE GOVERNOR', 'RESOURCE POOL', 'RESTORE', 'RESTORE FILELISTONLY', 'RESTORE HEADERONLY', 'RESTORE LABELONLY', 'RESTORE MASTER KEY', 'RESTORE REWINDONLY', 'RESTORE SERVICE MASTER KEY', 'RESTORE VERIFYONLY', 'REVERT', 'REVOKE', 'REVOKE XML', 'ROLE', 'ROUTE', 'ROWCOUNT', 'RULE', 'SCHEMA', 'SEARCH PROPERTY LIST', 'SECURITY POLICY', 'SELECTIVE XML INDEX', 'SEND', 'SENSITIVITY CLASSIFICATION', 'SEQUENCE', 'SERVER AUDIT', 'SERVER AUDIT SPECIFICATION', 'SERVER CONFIGURATION', 'SERVER ROLE', 'SERVICE', 'SERVICE MASTER KEY', 'SET', 'SETUSER', 'SHOWPLAN_ALL', 'SHOWPLAN_TEXT', 'SHOWPLAN_XML', 'SIGNATURE', 'SPATIAL INDEX', 'STATISTICS', 'STATISTICS IO', 'STATISTICS PROFILE', 'STATISTICS TIME', 'STATISTICS XML', 'SYMMETRIC KEY', 'SYNONYM', 'TABLE', 'TABLE IDENTITY', 'TEXTSIZE', 'TRANSACTION ISOLATION LEVEL', 'TRIGGER', 'TRUNCATE TABLE', 'TYPE', 'UPDATE', 'UPDATE STATISTICS', 'USER', 'VIEW', 'WORKLOAD GROUP', 'XACT_ABORT', 'XML INDEX', 'XML SCHEMA COLLECTION', // other | ||
'ALTER COLUMN', 'ALTER TABLE', 'CREATE TABLE', 'FROM', 'GROUP BY', 'HAVING', 'INSERT INTO', // verify | ||
var reservedCommands = (0, _expandPhrases.expandPhrases)([// queries | ||
'WITH', 'SELECT [ALL | DISTINCT]', 'FROM', 'WHERE', 'GROUP BY', 'HAVING', 'WINDOW', 'PARTITION BY', 'ORDER BY', 'OFFSET', 'FETCH {FIRST | NEXT}', // https://docs.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver15 | ||
'ADD SENSITIVITY CLASSIFICATION', 'ADD SIGNATURE', 'AGGREGATE', 'ANSI_DEFAULTS', 'ANSI_NULLS', 'ANSI_NULL_DFLT_OFF', 'ANSI_NULL_DFLT_ON', 'ANSI_PADDING', 'ANSI_WARNINGS', 'APPLICATION ROLE', 'ARITHABORT', 'ARITHIGNORE', 'ASSEMBLY', 'ASYMMETRIC KEY', 'AUTHORIZATION', 'AVAILABILITY GROUP', 'BACKUP', 'BACKUP CERTIFICATE', 'BACKUP MASTER KEY', 'BACKUP SERVICE MASTER KEY', 'BEGIN CONVERSATION TIMER', 'BEGIN DIALOG CONVERSATION', 'BROKER PRIORITY', 'BULK INSERT', 'CERTIFICATE', 'CLOSE MASTER KEY', 'CLOSE SYMMETRIC KEY', 'COLLATE', 'COLUMN ENCRYPTION KEY', 'COLUMN MASTER KEY', 'COLUMNSTORE INDEX', 'CONCAT_NULL_YIELDS_NULL', 'CONTEXT_INFO', 'CONTRACT', 'CREDENTIAL', 'CRYPTOGRAPHIC PROVIDER', 'CURSOR_CLOSE_ON_COMMIT', 'DATABASE', 'DATABASE AUDIT SPECIFICATION', 'DATABASE ENCRYPTION KEY', 'DATABASE HADR', 'DATABASE SCOPED CONFIGURATION', 'DATABASE SCOPED CREDENTIAL', 'DATABASE SET', 'DATEFIRST', 'DATEFORMAT', 'DEADLOCK_PRIORITY', 'DEFAULT', 'DELETE', 'DELETE FROM', 'DENY', 'DENY XML', 'DISABLE TRIGGER', 'ENABLE TRIGGER', 'END CONVERSATION', 'ENDPOINT', 'EVENT NOTIFICATION', 'EVENT SESSION', 'EXECUTE AS', 'EXTERNAL DATA SOURCE', 'EXTERNAL FILE FORMAT', 'EXTERNAL LANGUAGE', 'EXTERNAL LIBRARY', 'EXTERNAL RESOURCE POOL', 'EXTERNAL TABLE', 'FIPS_FLAGGER', 'FMTONLY', 'FORCEPLAN', 'FULLTEXT CATALOG', 'FULLTEXT INDEX', 'FULLTEXT STOPLIST', 'FUNCTION', 'GET CONVERSATION GROUP', 'GET_TRANSMISSION_STATUS', 'GRANT', 'GRANT XML', 'IDENTITY_INSERT', 'IMPLICIT_TRANSACTIONS', 'INDEX', 'INSERT', 'LANGUAGE', 'LOCK_TIMEOUT', 'LOGIN', 'MASTER KEY', 'MERGE', 'MESSAGE TYPE', 'MOVE CONVERSATION', 'NOCOUNT', 'NOEXEC', 'NUMERIC_ROUNDABORT', 'OFFSETS', 'OPEN MASTER KEY', 'OPEN SYMMETRIC KEY', 'PARSEONLY', 'PARTITION FUNCTION', 'PARTITION SCHEME', 'PROCEDURE', 'QUERY_GOVERNOR_COST_LIMIT', 'QUEUE', 'QUOTED_IDENTIFIER', 'RECEIVE', 'REMOTE SERVICE BINDING', 'REMOTE_PROC_TRANSACTIONS', 'RESOURCE GOVERNOR', 'RESOURCE POOL', 'RESTORE', 'RESTORE FILELISTONLY', 'RESTORE HEADERONLY', 'RESTORE LABELONLY', 'RESTORE MASTER KEY', 'RESTORE REWINDONLY', 'RESTORE SERVICE MASTER KEY', 'RESTORE VERIFYONLY', 'REVERT', 'REVOKE', 'REVOKE XML', 'ROLE', 'ROUTE', 'ROWCOUNT', 'RULE', 'SCHEMA', 'SEARCH PROPERTY LIST', 'SECURITY POLICY', 'SELECTIVE XML INDEX', 'SEND', 'SENSITIVITY CLASSIFICATION', 'SEQUENCE', 'SERVER AUDIT', 'SERVER AUDIT SPECIFICATION', 'SERVER CONFIGURATION', 'SERVER ROLE', 'SERVICE', 'SERVICE MASTER KEY', 'SET', 'SETUSER', 'SHOWPLAN_ALL', 'SHOWPLAN_TEXT', 'SHOWPLAN_XML', 'SIGNATURE', 'SPATIAL INDEX', 'STATISTICS', 'STATISTICS IO', 'STATISTICS PROFILE', 'STATISTICS TIME', 'STATISTICS XML', 'SYMMETRIC KEY', 'SYNONYM', 'TABLE', 'TABLE IDENTITY', 'TEXTSIZE', 'TRANSACTION ISOLATION LEVEL', 'TRIGGER', 'TRUNCATE TABLE', 'TYPE', 'UPDATE', 'UPDATE STATISTICS', 'USER', 'VIEW', 'WORKLOAD GROUP', 'XACT_ABORT', 'XML INDEX', 'XML SCHEMA COLLECTION', // other | ||
'ALTER COLUMN', 'ALTER TABLE', 'CREATE TABLE', 'INSERT INTO', // verify | ||
'DROP TABLE', // verify | ||
'SET SCHEMA', // verify | ||
'LIMIT', 'OFFSET', 'ORDER BY', 'SELECT', 'VALUES', 'WHERE', 'WITH', 'WINDOW', 'PARTITION BY']; | ||
'VALUES']); | ||
var reservedSetOperations = (0, _expandPhrases.expandPhrases)(['UNION [ALL]', 'EXCEPT', 'INTERSECT']); | ||
@@ -52,0 +53,0 @@ var reservedJoins = (0, _expandPhrases.expandPhrases)(['JOIN', '{LEFT | RIGHT | FULL} [OUTER] JOIN', '{INNER | CROSS} JOIN', // non-standard joins |
@@ -208,3 +208,4 @@ "use strict"; | ||
rest = _ref4.rest, | ||
dashes = _ref4.dashes; | ||
dashes = _ref4.dashes, | ||
allowFirstCharNumber = _ref4.allowFirstCharNumber; | ||
@@ -217,3 +218,3 @@ // Unicode letters, diacritical marks and underscore | ||
var restChars = (0, _regexUtil.escapeRegExp)(rest !== null && rest !== void 0 ? rest : ''); | ||
var pattern = "[".concat(letter).concat(firstChars, "][").concat(letter).concat(number).concat(restChars, "]*"); | ||
var pattern = allowFirstCharNumber ? "[".concat(letter).concat(number).concat(firstChars, "][").concat(letter).concat(number).concat(restChars, "]*") : "[".concat(letter).concat(firstChars, "][").concat(letter).concat(number).concat(restChars, "]*"); | ||
return dashes ? (0, _regexUtil.withDashes)(pattern) : pattern; | ||
@@ -220,0 +221,0 @@ }; |
@@ -77,3 +77,3 @@ "use strict"; | ||
}), _defineProperty(_this$validRules, _token.TokenType.NUMBER, { | ||
regex: new RegExp("(?:0x[0-9A-Fa-f]+|0b[01]+|(?:\\x2D[\\t-\\r \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]*)?[0-9]+(?:\\.[0-9]*)?(?:[Ee][\\+\\x2D]?[0-9]+(?:\\.[0-9]+)?)?)", "y") | ||
regex: new RegExp("(?:0x[0-9A-Fa-f]+|0b[01]+|(?:\\x2D[\\t-\\r \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]*)?[0-9]+(?:\\.[0-9]*)?(?:[Ee][\\+\\x2D]?[0-9]+(?:\\.[0-9]+)?)?)(?![0-9A-Z_a-z])", "y") | ||
}), _defineProperty(_this$validRules, _token.TokenType.RESERVED_CASE_START, { | ||
@@ -109,4 +109,4 @@ regex: new RegExp("[Cc][Aa][Ss][Ee]\\b", "y"), | ||
} | ||
}), _defineProperty(_this$validRules, _token.TokenType.RESERVED_KEYWORD, { | ||
regex: regex.reservedWord(cfg.reservedKeywords, cfg.identChars), | ||
}), _defineProperty(_this$validRules, _token.TokenType.RESERVED_LOGICAL_OPERATOR, { | ||
regex: regex.reservedWord((_cfg$reservedLogicalO = cfg.reservedLogicalOperators) !== null && _cfg$reservedLogicalO !== void 0 ? _cfg$reservedLogicalO : ['AND', 'OR'], cfg.identChars), | ||
value: function value(v) { | ||
@@ -120,4 +120,4 @@ return (0, _utils.equalizeWhitespace)(v.toUpperCase()); | ||
} | ||
}), _defineProperty(_this$validRules, _token.TokenType.RESERVED_LOGICAL_OPERATOR, { | ||
regex: regex.reservedWord((_cfg$reservedLogicalO = cfg.reservedLogicalOperators) !== null && _cfg$reservedLogicalO !== void 0 ? _cfg$reservedLogicalO : ['AND', 'OR'], cfg.identChars), | ||
}), _defineProperty(_this$validRules, _token.TokenType.RESERVED_KEYWORD, { | ||
regex: regex.reservedWord(cfg.reservedKeywords, cfg.identChars), | ||
value: function value(v) { | ||
@@ -124,0 +124,0 @@ return (0, _utils.equalizeWhitespace)(v.toUpperCase()); |
@@ -52,2 +52,2 @@ import type { IdentChars, QuoteType, VariableType } from './regexTypes'; | ||
*/ | ||
export declare const identifierPattern: ({ first, rest, dashes }?: IdentChars) => string; | ||
export declare const identifierPattern: ({ first, rest, dashes, allowFirstCharNumber, }?: IdentChars) => string; |
import { Token } from "./token"; | ||
import * as regexTypes from "./regexTypes"; | ||
import type * as regexTypes from "./regexTypes"; | ||
interface TokenizerOptions { | ||
@@ -4,0 +4,0 @@ reservedCommands: string[]; |
{ | ||
"name": "sql-formatter", | ||
"version": "9.0.0-beta.5", | ||
"version": "9.0.0-beta.6", | ||
"description": "Format whitespace in a SQL query to make it more readable", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1653367
258
7117