MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / CSVString

Method CSVString

internal/s3select/sql/value.go:302–328  ·  view source on GitHub ↗

CSVString - convert to string for CSV serialization

()

Source from the content-addressed store, hash-verified

300
301// CSVString - convert to string for CSV serialization
302func (v Value) CSVString() string {
303 switch x := v.value.(type) {
304 case nil, Missing:
305 return ""
306 case bool:
307 if x {
308 return "true"
309 }
310 return "false"
311 case string:
312 return x
313 case int64:
314 return strconv.FormatInt(x, 10)
315 case float64:
316 return strconv.FormatFloat(x, 'g', -1, 64)
317 case time.Time:
318 return FormatSQLTimestamp(x)
319 case []byte:
320 return string(x)
321 case []Value:
322 b, _ := json.Marshal(x)
323 return string(b)
324
325 default:
326 return "CSV serialization not implemented for this type"
327 }
328}
329
330// negate negates a numeric value
331func (v *Value) negate() {

Callers 2

TestValue_CSVStringFunction · 0.80
SetMethod · 0.80

Calls 1

FormatSQLTimestampFunction · 0.85

Tested by 1

TestValue_CSVStringFunction · 0.64