MCPcopy
hub / github.com/sqlc-dev/sqlc / GetColumnNames

Method GetColumnNames

internal/x/expander/expander_test.go:75–91  ·  view source on GitHub ↗
(ctx context.Context, query string)

Source from the content-addressed store, hash-verified

73}
74
75func (g *SQLiteColumnGetter) GetColumnNames(ctx context.Context, query string) ([]string, error) {
76 // Prepare the statement - this gives us column metadata without executing
77 stmt, _, err := g.conn.Prepare(query)
78 if err != nil {
79 return nil, err
80 }
81 defer stmt.Close()
82
83 // Get column names from the prepared statement
84 count := stmt.ColumnCount()
85 columns := make([]string, count)
86 for i := 0; i < count; i++ {
87 columns[i] = stmt.ColumnName(i)
88 }
89
90 return columns, nil
91}
92
93func TestExpandPostgreSQL(t *testing.T) {
94 ctx := context.Background()

Callers

nothing calls this directly

Calls 2

PrepareMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected