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

Struct MySQLColumnGetter

internal/x/expander/expander_test.go:57–59  ·  view source on GitHub ↗

MySQLColumnGetter implements ColumnGetter for MySQL. Column names are read from the result set metadata returned by executing the query; the test tables are empty, so no real rows are transferred. An earlier implementation pulled column metadata straight out of a prepared statement via a forked mys

Source from the content-addressed store, hash-verified

55// works with the upstream driver and keeps the test covering the same
56// behavior.
57type MySQLColumnGetter struct {
58 db *sql.DB
59}
60
61func (g *MySQLColumnGetter) GetColumnNames(ctx context.Context, query string) ([]string, error) {
62 rows, err := g.db.QueryContext(ctx, query)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected