feat: support more Postgres index syntax (#943)

This commit is contained in:
Forbes Lindesay 2023-08-17 16:47:11 +01:00 committed by GitHub
parent a49ea1908d
commit 9a39afbe07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 279 additions and 10 deletions

View file

@ -5981,7 +5981,7 @@ fn parse_create_index() {
];
match verified_stmt(sql) {
Statement::CreateIndex {
name,
name: Some(name),
table_name,
columns,
unique,
@ -6015,19 +6015,25 @@ fn test_create_index_with_using_function() {
];
match verified_stmt(sql) {
Statement::CreateIndex {
name,
name: Some(name),
table_name,
using,
columns,
unique,
concurrently,
if_not_exists,
include,
nulls_distinct: None,
predicate: None,
} => {
assert_eq!("idx_name", name.to_string());
assert_eq!("test", table_name.to_string());
assert_eq!("btree", using.unwrap().to_string());
assert_eq!(indexed_columns, columns);
assert!(unique);
assert!(if_not_exists)
assert!(!concurrently);
assert!(if_not_exists);
assert!(include.is_empty());
}
_ => unreachable!(),
}