QueryCatalog is a helper function to query the catalog, such as information_schema. Unlike QueryContext, this function does not require a schema name to be set on the connection, and the current schema of the connection does not matter.
(ctx *sql.Context, query string, args ...any)
| 76 | // Unlike QueryContext, this function does not require a schema name to be set on the connection, |
| 77 | // and the current schema of the connection does not matter. |
| 78 | func QueryCatalog(ctx *sql.Context, query string, args ...any) (*stdsql.Rows, error) { |
| 79 | conn, err := ctx.Session.(ConnectionHolder).GetCatalogConn(ctx) |
| 80 | if err != nil { |
| 81 | return nil, err |
| 82 | } |
| 83 | return conn.QueryContext(ctx, query, args...) |
| 84 | } |
| 85 | |
| 86 | func QueryRowCatalog(ctx *sql.Context, query string, args ...any) *stdsql.Row { |
| 87 | conn, err := ctx.Session.(ConnectionHolder).GetCatalogConn(ctx) |
no test coverage detected