summaryrefslogtreecommitdiffstats
path: root/tests/test_build.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_build.py')
-rw-r--r--tests/test_build.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_build.py b/tests/test_build.py
index 817b609..f0c631f 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -653,6 +653,18 @@ class TestBuild(unittest.TestCase):
lambda: exp.cast_unless("CAST(x AS TEXT)", "int", "int"),
"CAST(CAST(x AS TEXT) AS INT)",
),
+ (
+ lambda: exp.rename_column("table1", "c1", "c2", True),
+ "ALTER TABLE table1 RENAME COLUMN IF EXISTS c1 TO c2",
+ ),
+ (
+ lambda: exp.rename_column("table1", "c1", "c2", False),
+ "ALTER TABLE table1 RENAME COLUMN c1 TO c2",
+ ),
+ (
+ lambda: exp.rename_column("table1", "c1", "c2"),
+ "ALTER TABLE table1 RENAME COLUMN c1 TO c2",
+ ),
]:
with self.subTest(sql):
self.assertEqual(expression().sql(dialect[0] if dialect else None), sql)