should be it
This commit is contained in:
30
external/duckdb/extension/autocomplete/grammar/statements/copy.gram
vendored
Normal file
30
external/duckdb/extension/autocomplete/grammar/statements/copy.gram
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
CopyStatement <- 'COPY' (CopyTable / CopySelect / CopyFromDatabase)
|
||||
|
||||
CopyTable <- BaseTableName InsertColumnList? FromOrTo CopyFileName CopyOptions?
|
||||
FromOrTo <- 'FROM' / 'TO'
|
||||
|
||||
CopySelect <- Parens(SelectStatement) 'TO' CopyFileName CopyOptions?
|
||||
|
||||
CopyFileName <- Expression / StringLiteral / Identifier / (Identifier '.' ColId)
|
||||
CopyOptions <- 'WITH'? (Parens(GenericCopyOptionList) / (SpecializedOptions*))
|
||||
SpecializedOptions <-
|
||||
'BINARY' / 'FREEZE' / 'OIDS' / 'CSV' / 'HEADER' /
|
||||
SpecializedStringOption /
|
||||
('ENCODING' StringLiteral) /
|
||||
('FORCE' 'QUOTE' StarOrColumnList) /
|
||||
('PARTITION' 'BY' StarOrColumnList) /
|
||||
('FORCE' 'NOT'? 'NULL' ColumnList)
|
||||
|
||||
SpecializedStringOption <- ('DELIMITER' / 'NULL' / 'QUOTE' / 'ESCAPE') 'AS'? StringLiteral
|
||||
|
||||
StarOrColumnList <- '*' / ColumnList
|
||||
|
||||
GenericCopyOptionList <- List(GenericCopyOption)
|
||||
GenericCopyOption <- GenericCopyOptionName Expression?
|
||||
# FIXME: should not need to hard-code options here
|
||||
GenericCopyOptionName <- 'ARRAY' / 'NULL' / 'ANALYZE' / CopyOptionName
|
||||
|
||||
CopyFromDatabase <- 'FROM' 'DATABASE' ColId 'TO' ColId CopyDatabaseFlag?
|
||||
|
||||
CopyDatabaseFlag <- Parens(SchemaOrData)
|
||||
SchemaOrData <- 'SCHEMA' / 'DATA'
|
||||
Reference in New Issue
Block a user