amaksimo commented on code in PR #2302:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2302#discussion_r3163108550
##########
tests/sqlparser_postgres.rs:
##########
@@ -3217,6 +3227,58 @@ fn parse_create_index_concurrently() {
}
}
+#[test]
+fn parse_create_index_async() {
+ let sql = "CREATE INDEX ASYNC my_index ON my_table(col1)";
+ match pg().verified_stmt(sql) {
+ Statement::CreateIndex(CreateIndex {
+ name: Some(ObjectName(name)),
+ table_name: ObjectName(table_name),
+ using,
+ columns,
+ unique,
+ concurrently,
+ r#async,
+ if_not_exists,
+ include,
+ nulls_distinct: None,
+ with,
+ predicate: None,
+ index_options,
+ alter_options,
+ }) => {
+ assert_eq_vec(&["my_index"], &name);
+ assert_eq_vec(&["my_table"], &table_name);
+ assert_eq!(None, using);
+ assert!(!unique);
+ assert!(!concurrently);
+ assert!(r#async);
+ assert!(!if_not_exists);
+ assert_eq_vec(&["col1"], &columns);
+ assert!(include.is_empty());
+ assert!(with.is_empty());
+ assert!(index_options.is_empty());
+ assert!(alter_options.is_empty());
+ }
+ _ => unreachable!(),
+ }
Review Comment:
Done, simplified both tests to round-trip verified_stmt() calls and moved
them to sqlparser_common.rs.
Thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]