Skip to content

Commit

Permalink
support storing() in create vector index. fix #377
Browse files Browse the repository at this point in the history
  • Loading branch information
kitta65 committed May 12, 2024
1 parent 9d515c0 commit b5610a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions expected_output/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ OPTIONS (dummy = 'dummy')

CREATE OR REPLACE VECTOR INDEX new_index
ON tablename (col)
STORING (a, b, c)
OPTIONS (dummy = 'dummy')
;

Expand Down
1 change: 1 addition & 0 deletions input/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ options (dummy = 'dummy')

create or replace vector index new_index
on tablename(col)
storing (a, b, c)
options (dummy = 'dummy')
;

Expand Down
3 changes: 3 additions & 0 deletions src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,7 @@ const printCreateIndexStatement: PrintFunc<bq2cst.CreateIndexStatement> = (
on: p.child("on"),
tablename: p.child("tablename", undefined, "all"),
column_group: p.child("column_group", undefined, "all"),
storing: p.child("storing"),
options: p.child("options"),
semicolon: p.child("semicolon"),
};
Expand All @@ -2476,6 +2477,8 @@ const printCreateIndexStatement: PrintFunc<bq2cst.CreateIndexStatement> = (
docs.tablename,
" ",
docs.column_group,
p.has("storing") ? line : "",
docs.storing,
p.has("options") ? line : "",
docs.options,
softline,
Expand Down

0 comments on commit b5610a7

Please sign in to comment.