MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / createResultsArray

Method createResultsArray

plugins/destination/sqlite/client/read.go:19–41  ·  view source on GitHub ↗
(table *arrow.Schema)

Source from the content-addressed store, hash-verified

17)
18
19func (*Client) createResultsArray(table *arrow.Schema) []any {
20 results := make([]any, 0, len(table.Fields()))
21 for _, col := range table.Fields() {
22 switch col.Type.ID() {
23 case arrow.BOOL:
24 var r sql.NullBool
25 results = append(results, &r)
26 case arrow.BINARY, arrow.LARGE_BINARY:
27 var r []byte
28 results = append(results, &r)
29 case arrow.INT8, arrow.INT16, arrow.INT32, arrow.INT64, arrow.UINT8, arrow.UINT16, arrow.UINT32, arrow.UINT64:
30 var r sql.NullInt64
31 results = append(results, &r)
32 case arrow.FLOAT16, arrow.FLOAT32, arrow.FLOAT64:
33 var r sql.NullFloat64
34 results = append(results, &r)
35 default:
36 var r sql.NullString
37 results = append(results, &r)
38 }
39 }
40 return results
41}
42
43func reverseTransform(sc *arrow.Schema, values []any) (arrow.RecordBatch, error) {
44 bldr := array.NewRecordBuilder(memory.DefaultAllocator, sc)

Callers 1

ReadMethod · 0.95

Calls 1

IDMethod · 0.45

Tested by

no test coverage detected