Skip to content

Commit c65202b

Browse files
committed
fix(search): use catalog alias for bm25_search table ref
bm25_search passes its table reference as a string literal to the server, which now rewrites catalog aliases (e.g. "default") to the real managed connection name before execution. Use db.default_catalog as the prefix for both BM25 and vector table refs so both search types route through the same catalog alias resolution path.
1 parent 2cea084 commit c65202b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -844,11 +844,9 @@ fn main() {
844844
let db_id = db.id.clone();
845845
let conn_id = db.default_connection_id;
846846

847-
// bm25_search takes a string literal for the table path; the server resolves
848-
// catalog aliases (like "default") only in SQL FROM clauses, not in string
849-
// arguments. Use the connection ID as the catalog prefix so it resolves directly.
850-
let bm25_table = format!("{}.{}.{}", conn_id, resolved_schema, table);
851-
// vector queries run as standard SQL with X-Database-Id, so the catalog alias works.
847+
// Both search types run as SQL with X-Database-Id; the server rewrites
848+
// catalog aliases (like "default") to the real connection name before execution.
849+
let bm25_table = format!("{}.{}.{}", db.default_catalog, resolved_schema, table);
852850
let vector_table = format!("{}.{}.{}", db.default_catalog, resolved_schema, table);
853851

854852
// Infer --type and --column from the table's indexes when either is omitted.

0 commit comments

Comments
 (0)