@@ -474,13 +474,24 @@ func (this *ExtractDDL) Evaluate(item value.Value, context Context) (value.Value
474474 with = value .NewValue (map [string ]interface {}{})
475475 }
476476
477+ // Strip surrounding backticks from filter if present (e.g., '`travel-sample`' -> 'travel-sample')
478+ filterSpecified := filter != nil && filter .ToString () != ""
479+ if filterSpecified {
480+ filterStr := strings .Trim (filter .ToString (), "`" )
481+ if filterStr != "" {
482+ filter = value .NewValue (filterStr )
483+ } else {
484+ filterSpecified = false
485+ }
486+ }
487+
477488 res := make ([]interface {}, 0 , 32 )
478489 args := make (value.Values , 0 , 1 )
479490
480491 var buf strings.Builder
481492 buf .Grow (128 ) // Pre-allocate buffer for the initial query
482493 buf .WriteString ("SELECT DISTINCT RAW name FROM system:keyspaces WHERE `namespace` = 'default' AND `bucket` IS NOT VALUED " )
483- if filter != nil && filter . ToString () != "" {
494+ if filterSpecified {
484495 buf .WriteString (" AND name LIKE ?" )
485496 args = append (args , filter )
486497 }
@@ -544,8 +555,8 @@ func (this *ExtractDDL) Evaluate(item value.Value, context Context) (value.Value
544555 }
545556 }
546557
547- // Extract global functions first (independent of buckets)
548- if flags & _FUNCTION_INFO != 0 {
558+ // Extract global functions first (independent of buckets), but only when no specific bucket filter is specified
559+ if flags & _FUNCTION_INFO != 0 && ! filterSpecified {
549560 stmt := "SELECT functions FROM system:functions " +
550561 "WHERE functions.identity.type = 'global' " +
551562 "ORDER BY functions.identity.name"
0 commit comments