MCPcopy Create free account
hub / github.com/apecloud/myduckserver / ParseFormat

Function ParseFormat

pgserver/copy.go:30–48  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

28)
29
30func 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.
51func ParseCopyTo(stmt string) (query string, format tree.CopyFormat, options string, ok bool) {

Callers 2

ParseCopyToFunction · 0.85
ParseCopyFromFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected