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

Function columnTypeHint

backend/loaddata.go:273–288  ·  view source on GitHub ↗
(b *strings.Builder, col *sql.Column)

Source from the content-addressed store, hash-verified

271}
272
273func columnTypeHint(b *strings.Builder, col *sql.Column) error {
274 b.WriteString(catalog.QuoteIdentifierANSI(col.Name))
275 b.WriteString(": ")
276 if dt, err := catalog.DuckdbDataType(col.Type); err != nil {
277 return err
278 } else {
279 b.WriteString(`'`)
280 if col.Type.Type() == query.Type_ENUM {
281 b.WriteString(`VARCHAR`)
282 } else {
283 b.WriteString(dt.Name())
284 }
285 b.WriteString(`'`)
286 }
287 return nil
288}
289
290// isUnderSecureFileDir ensures that fileStr is under secureFileDir or a subdirectory of secureFileDir, errors otherwise
291// Copied from https://github.com/dolthub/go-mysql-server/blob/main/sql/rowexec/rel.go

Callers 1

columnTypeHintsFunction · 0.85

Calls 4

QuoteIdentifierANSIFunction · 0.92
DuckdbDataTypeFunction · 0.92
TypeMethod · 0.80
NameMethod · 0.45

Tested by

no test coverage detected