Expand description
Textual parser for COPY ... FROM STDIN statements.
COPY FROM STDIN is parsed here instead of through sqlparser because the
WITH (...) option list is open: formats may accept options beyond
sqlparserโs COPY grammar (for example a line-protocol format taking
precision), and unknown options must reach the format codec rather
than fail statement parsing.
The parser commits to error reporting only after FROM STDIN has been
seen; anything else (like COPY ... TO STDOUT) is reported as
CopyInScan::NotCopyIn so the caller falls back to the regular SQL
path.
Structsยง
- RawCopy
From ๐Stdin - A scanned
COPY tbl [(cols)] FROM STDIN [WITH (...)]statement. - Tokens ๐
Enumsยง
- Copy
InScan ๐
Functionsยง
- expect_
ident ๐ - Returns the identifier with the SQL parserโs canonicalization: quoted identifiers keep their case, unquoted ones fold to lowercase.
- parse_
column_ ๐list - Parses an optional
(column, ...)list.Nonemeans the statement is not a copy-in shape (either no list, or a malformed list better left to the regular parser to report). - parse_
object_ ๐name - parse_
option_ ๐list - Parses
NAME [value] (, NAME [value])*until the closing). - scan_
copy_ ๐from_ stdin - Scans a SQL string for a leading
COPY ... FROM STDINstatement.