mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 10:47:22 +00:00
feat: support more Postgres index syntax (#943)
This commit is contained in:
parent
a49ea1908d
commit
9a39afbe07
5 changed files with 279 additions and 10 deletions
|
@ -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!(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue