Support create index with clause (#1389)

Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
张林伟 2024-09-01 19:38:20 +08:00 committed by GitHub
parent d64beea4d4
commit 4d52ee7280
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 92 additions and 0 deletions

View file

@ -5324,6 +5324,17 @@ impl<'a> Parser<'a> {
None
};
let with = if self.dialect.supports_create_index_with_clause()
&& self.parse_keyword(Keyword::WITH)
{
self.expect_token(&Token::LParen)?;
let with_params = self.parse_comma_separated(Parser::parse_expr)?;
self.expect_token(&Token::RParen)?;
with_params
} else {
Vec::new()
};
let predicate = if self.parse_keyword(Keyword::WHERE) {
Some(self.parse_expr()?)
} else {
@ -5340,6 +5351,7 @@ impl<'a> Parser<'a> {
if_not_exists,
include,
nulls_distinct,
with,
predicate,
}))
}