Skip to content

Commit

Permalink
update parse_create_search_index_statement
Browse files Browse the repository at this point in the history
  • Loading branch information
kitta65 committed May 12, 2024
1 parent ce0e3f0 commit 2f56967
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,10 @@ impl Parser {
} else {
create.push_node("column_group", self.parse_grouped_exprs(false)?);
}
if self.get_token(1)?.is("STORING") {
self.next_token()?; // -> STORING
create.push_node("storing", self.parse_keyword_with_grouped_exprs(false)?);
}
if self.get_token(1)?.is("OPTIONS") {
self.next_token()?; // -> OPTIONS
create.push_node("options", self.parse_keyword_with_grouped_exprs(false)?);
Expand Down
15 changes: 15 additions & 0 deletions src/parser/tests/tests_ddl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ what:
Box::new(SuccessTestCase::new(
"\
CREATE OR REPLACE VECTOR INDEX new_index ON tablename(col)
STORING(a, b, c)
OPTIONS(dummy='dummy')
",
"\
Expand Down Expand Up @@ -169,6 +170,20 @@ options:
or_replace:
- self: OR (Keyword)
- self: REPLACE (Keyword)
storing:
self: STORING (KeywordWithGroupedXXX)
group:
self: ( (GroupedExprs)
exprs:
- self: a (Identifier)
comma:
self: , (Symbol)
- self: b (Identifier)
comma:
self: , (Symbol)
- self: c (Identifier)
rparen:
self: ) (Symbol)
tablename:
self: tablename (Identifier)
what:
Expand Down
1 change: 1 addition & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ export type CreateIndexStatement = XXXStatement & {
on: NodeChild;
tablename: NodeChild;
column_group: NodeChild;
storing?: NodeChild;
options?: NodeChild;
};
};
Expand Down

0 comments on commit 2f56967

Please sign in to comment.