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

Function QueryCatalog

adapter/adapter.go:78–84  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
78func 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
86func QueryRowCatalog(ctx *sql.Context, query string, args ...any) *stdsql.Row {
87 conn, err := ctx.Session.(ConnectionHolder).GetCatalogConn(ctx)

Callers 11

AllDatabasesMethod · 0.92
hasDatabaseFunction · 0.92
findTablesMethod · 0.92
getPrimaryKeyOrdinalsFunction · 0.92
GetIndexesMethod · 0.92
queryColumnsFunction · 0.92
executeQueryMethod · 0.92
executeBoundPlanMethod · 0.92
doSnapshotMethod · 0.92
UpdateSubscriptionsFunction · 0.92

Calls 2

QueryContextMethod · 0.80
GetCatalogConnMethod · 0.65

Tested by

no test coverage detected