Skip to content

Commit 14dda9f

Browse files
committed
Use one_statement_parses_to
1 parent 06c6b35 commit 14dda9f

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tests/sqlparser_snowflake.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -447,16 +447,25 @@ fn test_snowflake_create_table_if_not_exists() {
447447
_ => unreachable!(),
448448
}
449449

450-
for sql in [
451-
r#"CREATE TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
452-
r#"CREATE TABLE "A"."B"."C" IF NOT EXISTS (v VARIANT)"#,
453-
r#"CREATE TRANSIENT TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
454-
r#"CREATE TRANSIENT TABLE "A"."B"."C" IF NOT EXISTS (v VARIANT)"#,
450+
for (sql, parse_to) in [
451+
(
452+
r#"CREATE TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
453+
r#"CREATE TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
454+
),
455+
(
456+
r#"CREATE TABLE "A"."B"."C" IF NOT EXISTS (v VARIANT)"#,
457+
r#"CREATE TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
458+
),
459+
(
460+
r#"CREATE TRANSIENT TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
461+
r#"CREATE TRANSIENT TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
462+
),
463+
(
464+
r#"CREATE TRANSIENT TABLE "A"."B"."C" IF NOT EXISTS (v VARIANT)"#,
465+
r#"CREATE TRANSIENT TABLE IF NOT EXISTS "A"."B"."C" (v VARIANT)"#,
466+
),
455467
] {
456-
// We don't use `verified_stmt` here because the parser won't produce a 1:1 result of the
457-
// query. We will always put the `IF NOT EXIST` before the column name when displaying the
458-
// query.
459-
assert!(snowflake().parse_sql_statements(sql).is_ok());
468+
snowflake().one_statement_parses_to(sql, parse_to);
460469
}
461470
}
462471

0 commit comments

Comments
 (0)