Skip to content

Commit

Permalink
Merge pull request #360 from kitta65/feature/20240507
Browse files Browse the repository at this point in the history
update parse_create_search_index_statement
  • Loading branch information
kitta65 committed May 12, 2024
2 parents ce0e3f0 + 356bb03 commit bd20851
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bq2cst"
version = "0.5.4"
version = "0.5.5"
authors = ["kitta65 <skndr666m1@gmail.com>"]
edition = "2018"
license = "MIT"
Expand Down
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 bd20851

Please sign in to comment.