diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-01-23 05:06:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-01-23 05:06:10 +0000 |
commit | 258c7df9cab21a4978c100568907ac1cb7fd6ee0 (patch) | |
tree | a98c4c9fc7433833be72543de5d99d15b9927442 /tests/test_build.py | |
parent | Adding upstream version 20.4.0. (diff) | |
download | sqlglot-258c7df9cab21a4978c100568907ac1cb7fd6ee0.tar.xz sqlglot-258c7df9cab21a4978c100568907ac1cb7fd6ee0.zip |
Adding upstream version 20.9.0.upstream/20.9.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_build.py')
-rw-r--r-- | tests/test_build.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_build.py b/tests/test_build.py index 087bc7e..817b609 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -86,6 +86,8 @@ class TestBuild(unittest.TestCase): "CASE x WHEN 1 THEN x ELSE bar END", ), (lambda: exp.func("COALESCE", "x", 1), "COALESCE(x, 1)"), + (lambda: exp.column("x").desc(), "x DESC"), + (lambda: exp.column("x").desc(nulls_first=True), "x DESC NULLS FIRST"), (lambda: select("x"), "SELECT x"), (lambda: select("x"), "SELECT x"), (lambda: select("x", "y"), "SELECT x, y"), @@ -631,6 +633,10 @@ class TestBuild(unittest.TestCase): "INSERT INTO tbl (cola, colb) VALUES (1, 2), (3, 4)", ), ( + lambda: exp.insert("VALUES (1), (2)", "tbl", columns=["col a"]), + 'INSERT INTO tbl ("col a") VALUES (1), (2)', + ), + ( lambda: exp.insert("SELECT * FROM cte", "t").with_("cte", as_="SELECT x FROM tbl"), "WITH cte AS (SELECT x FROM tbl) INSERT INTO t SELECT * FROM cte", ), |