should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View 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'