feat: update alter and drop statements (#94)
* feat: add UNIQUE keyword * feat: support ifExist, addConstraint, dropConstraint and addUnique of alter table statement * feat: support ifExist, addConstraint, dropConstraint and addUnique of alter table statement * tests: add tests of alter statements * docs: add comments for sql syntax * build: optimize promote of build/antlr4 * ci: add max_old_space_size * ci: add max_old_space_size * ci: update tests script
This commit is contained in:
@ -277,19 +277,37 @@ jarFileName
|
||||
;
|
||||
|
||||
// Alter statements
|
||||
// Just for simple alter table statements,
|
||||
// it only includes rename, set key, add constraint, drop constraint, add unique
|
||||
|
||||
alterTable
|
||||
: ALTER TABLE uid (renameDefinition | setKeyValueDefinition)
|
||||
: ALTER TABLE ifExists? uid (renameDefinition | setKeyValueDefinition | addConstraint | dropConstraint | addUnique)
|
||||
;
|
||||
|
||||
renameDefinition
|
||||
: RENAME TO uid
|
||||
: RENAME uid? TO uid
|
||||
;
|
||||
|
||||
setKeyValueDefinition
|
||||
: SET tablePropertyList
|
||||
;
|
||||
|
||||
addConstraint
|
||||
: ADD CONSTRAINT constraintName PRIMARY KEY columnNameList notForced?
|
||||
;
|
||||
|
||||
dropConstraint
|
||||
: DROP CONSTRAINT constraintName
|
||||
;
|
||||
|
||||
addUnique
|
||||
: ADD UNIQUE columnNameList
|
||||
;
|
||||
|
||||
notForced
|
||||
: NOT ENFORCED
|
||||
;
|
||||
|
||||
alertView
|
||||
: ALTER VIEW uid (renameDefinition | AS queryStatement)
|
||||
;
|
||||
|
Reference in New Issue
Block a user