davidhcoe commented on code in PR #2254:
URL: https://github.com/apache/arrow-adbc/pull/2254#discussion_r1802311954
##########
go/adbc/driver/snowflake/connection.go:
##########
@@ -85,82 +127,165 @@ func (c *connectionImpl) GetObjects(ctx context.Context,
depth adbc.ObjectDepth,
defer conn.Close()
gQueryIDs, gQueryIDsCtx := errgroup.WithContext(ctx)
+
queryFile := queryTemplateGetObjectsAll
switch depth {
case adbc.ObjectDepthCatalogs:
- if catalog == nil {
- queryFile = queryTemplateGetObjectsTerseCatalogs
- // if the catalog is null, show the terse databases
- // which doesn't require a database context
- gQueryIDs.Go(func() error {
- return conn.Raw(func(driverConn any) error {
- rows, err :=
driverConn.(driver.QueryerContext).QueryContext(gQueryIDsCtx, "SHOW TERSE
DATABASES", nil)
- if err != nil {
- return err
- }
+ queryFile = queryTemplateGetObjectsTerseCatalogs
+ gQueryIDs.Go(func() error {
+ return conn.Raw(func(driverConn any) (err error) {
+ query := "SHOW TERSE /* ADBC:getObjectsCatalogs
*/ DATABASES"
+ if catalog != nil && len(*catalog) > 0 &&
*catalog != "%" && *catalog != ".*" {
+ query += " LIKE '" +
escapeSingleQuoteForLike(*catalog) + "'"
Review Comment:
I believe this will be a case sensitive search (LIKE) and will it also treat
names with underscores as wildcards?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]