Skeleton for DDL create statement handling

This commit is contained in:
Zach Musgrave
2019-04-01 15:51:24 -07:00
parent f498b37df8
commit 979f653a65
4 changed files with 402 additions and 11 deletions

View File

@@ -0,0 +1,211 @@
package sql
// SQL keyword constants for use in switches and comparisons
const (
ADD = "add"
AGAINST = "against"
ALL = "all"
ALTER = "alter"
ANALYZE = "analyze"
AND = "and"
AS = "as"
ASC = "asc"
AUTO_INCREMENT = "auto_increment"
BEGIN = "begin"
BETWEEN = "between"
BIGINT = "bigint"
BINARY = "binary"
BIT = "bit"
BLOB = "blob"
BOOL = "bool"
BOOLEAN = "boolean"
BY = "by"
CASE = "case"
CAST = "cast"
CHAR = "char"
CHARACTER = "character"
CHARSET = "charset"
COLLATE = "collate"
COLUMN = "column"
COMMENT = "comment"
COMMIT = "commit"
COMMITTED = "committed"
CONSTRAINT = "constraint"
CONVERT = "convert"
CREATE = "create"
CROSS = "cross"
CURRENT_DATE = "current_date"
CURRENT_TIME = "current_time"
CURRENT_TIMESTAMP = "current_timestamp"
DATABASE = "database"
DATABASES = "databases"
DATE = "date"
DATETIME = "datetime"
DECIMAL = "decimal"
DEFAULT = "default"
DELETE = "delete"
DESC = "desc"
DESCRIBE = "describe"
DISTINCT = "distinct"
DIV = "div"
DOUBLE = "double"
DROP = "drop"
DUPLICATE = "duplicate"
ELSE = "else"
END = "end"
ENUM = "enum"
ESCAPE = "escape"
EXISTS = "exists"
EXPANSION = "expansion"
EXPLAIN = "explain"
EXTENDED = "extended"
FALSE = "false"
FLOAT_TYPE = "float"
FOR = "for"
FORCE = "force"
FOREIGN = "foreign"
FROM = "from"
FULL = "full"
FULLTEXT = "fulltext"
GEOMETRY = "geometry"
GEOMETRYCOLLECTION = "geometrycollection"
GLOBAL = "global"
GROUP = "group"
GROUP_CONCAT = "group_concat"
HAVING = "having"
IF = "if"
IGNORE = "ignore"
IN = "in"
INDEX = "index"
INNER = "inner"
INSERT = "insert"
INT = "int"
INTEGER = "integer"
INTERVAL = "interval"
INTO = "into"
IS = "is"
ISOLATION = "isolation"
JOIN = "join"
JSON = "json"
KEY = "key"
KEYS = "keys"
KEY_BLOCK_SIZE = "key_block_size"
LANGUAGE = "language"
LAST_INSERT_ID = "last_insert_id"
LEFT = "left"
LESS = "less"
LEVEL = "level"
LIKE = "like"
LIMIT = "limit"
LINESTRING = "linestring"
LOCALTIME = "localtime"
LOCALTIMESTAMP = "localtimestamp"
LOCK = "lock"
LONGBLOB = "longblob"
LONGTEXT = "longtext"
MATCH = "match"
MAXVALUE = "maxvalue"
MEDIUMBLOB = "mediumblob"
MEDIUMINT = "mediumint"
MEDIUMTEXT = "mediumtext"
MOD = "mod"
MODE = "mode"
MULTILINESTRING = "multilinestring"
MULTIPOINT = "multipoint"
MULTIPOLYGON = "multipolygon"
NAMES = "names"
NATURAL = "natural"
NCHAR = "nchar"
NEXT = "next"
NOT = "not"
NULL = "null"
NUMERIC = "numeric"
OFFSET = "offset"
ON = "on"
ONLY = "only"
OPTIMIZE = "optimize"
OR = "or"
ORDER = "order"
OUTER = "outer"
PARTITION = "partition"
POINT = "point"
POLYGON = "polygon"
PRIMARY = "primary"
PROCEDURE = "procedure"
PROCESSLIST = "processlist"
QUERY = "query"
READ = "read"
REAL = "real"
REGEXP = "regexp"
RLIKE = "rlike"
RENAME = "rename"
REORGANIZE = "reorganize"
REPAIR = "repair"
REPEATABLE = "repeatable"
REPLACE = "replace"
RIGHT = "right"
ROLLBACK = "rollback"
SCHEMA = "schema"
SELECT = "select"
SEPARATOR = "separator"
SERIALIZABLE = "serializable"
SESSION = "session"
SET = "set"
SHARE = "share"
SHOW = "show"
SIGNED = "signed"
SMALLINT = "smallint"
SPATIAL = "spatial"
SQL_CACHE = "sql_cache"
SQL_NO_CACHE = "sql_no_cache"
START = "start"
STATUS = "status"
STRAIGHT_JOIN = "straight_join"
STREAM = "stream"
SUBSTR = "substr"
SUBSTRING = "substring"
TABLE = "table"
TABLES = "tables"
TEXT = "text"
THAN = "than"
THEN = "then"
TIME = "time"
TIMESTAMP = "timestamp"
TINYBLOB = "tinyblob"
TINYINT = "tinyint"
TINYTEXT = "tinytext"
TO = "to"
TRANSACTION = "transaction"
TRIGGER = "trigger"
TRUE = "true"
TRUNCATE = "truncate"
UNCOMMITTED = "uncommitted"
UNDERSCORE_BINARY = "_binary"
UNION = "union"
UNIQUE = "unique"
UNSIGNED = "unsigned"
UPDATE = "update"
USE = "use"
USING = "using"
UTC_DATE = "utc_date"
UTC_TIME = "utc_time"
UTC_TIMESTAMP = "utc_timestamp"
VALUES = "values"
VARBINARY = "varbinary"
VARCHAR = "varchar"
VARIABLES = "variables"
VIEW = "view"
VINDEX = "vindex"
VINDEXES = "vindexes"
VITESS_KEYSPACES = "vitess_keyspaces"
VITESS_SHARDS = "vitess_shards"
VITESS_TABLETS = "vitess_tablets"
VSCHEMA_TABLES = "vschema_tables"
WHEN = "when"
WHERE = "where"
WITH = "with"
WRITE = "write"
YEAR = "year"
ZEROFILL = "zerofill"
)