mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
sql: Add support of escape quote in CSV (#9231)
This commit modifies csv parser, a fork of golang csv parser to support a custom quote escape character. The quote escape character is used to escape the quote character when a csv field contains a quote character as part of data.
This commit is contained in:
@@ -39,6 +39,14 @@ const (
|
||||
SelectFmtParquet
|
||||
)
|
||||
|
||||
// WriteCSVOpts - encapsulates options for Select CSV output
|
||||
type WriteCSVOpts struct {
|
||||
FieldDelimiter rune
|
||||
Quote rune
|
||||
QuoteEscape rune
|
||||
AlwaysQuote bool
|
||||
}
|
||||
|
||||
// Record - is a type containing columns and their values.
|
||||
type Record interface {
|
||||
Get(name string) (*Value, error)
|
||||
@@ -46,7 +54,7 @@ type Record interface {
|
||||
// Set a value.
|
||||
// Can return a different record type.
|
||||
Set(name string, value *Value) (Record, error)
|
||||
WriteCSV(writer io.Writer, fieldDelimiter, quote rune, alwaysQuote bool) error
|
||||
WriteCSV(writer io.Writer, opts WriteCSVOpts) error
|
||||
WriteJSON(writer io.Writer) error
|
||||
|
||||
// Clone the record and if possible use the destination provided.
|
||||
|
||||
Reference in New Issue
Block a user