(s string)
| 28 | ) |
| 29 | |
| 30 | func ParseFormat(s string) (format tree.CopyFormat, ok bool) { |
| 31 | switch strings.ToUpper(s) { |
| 32 | case "PARQUET": |
| 33 | format = CopyFormatParquet |
| 34 | case "JSON": |
| 35 | format = CopyFormatJSON |
| 36 | case "ARROW": |
| 37 | format = CopyFormatArrow |
| 38 | case "CSV": |
| 39 | format = tree.CopyFormatCSV |
| 40 | case "BINARY": |
| 41 | format = tree.CopyFormatBinary |
| 42 | case "", "TEXT": |
| 43 | format = tree.CopyFormatText |
| 44 | default: |
| 45 | return 0, false |
| 46 | } |
| 47 | return format, true |
| 48 | } |
| 49 | |
| 50 | // ParseCopyTo parses a COPY TO statement and returns the query, format, and options. |
| 51 | func ParseCopyTo(stmt string) (query string, format tree.CopyFormat, options string, ok bool) { |
no outgoing calls
no test coverage detected