1
0
Fork 0

Adding upstream version 11.4.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 15:45:33 +01:00
parent d160fb48f7
commit 36706608dc
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
89 changed files with 35352 additions and 33081 deletions

View file

@ -1,5 +1,6 @@
import unittest
from sqlglot import parse_one
from sqlglot.expressions import Func
from sqlglot.parser import Parser
from sqlglot.tokens import Tokenizer
@ -28,3 +29,12 @@ class TestGenerator(unittest.TestCase):
tokens = Tokenizer().tokenize("SELECT SPECIAL_UDF(a, b, c, d + 1) FROM x")
expression = NewParser().parse(tokens)[0]
self.assertEqual(expression.sql(), "SELECT SPECIAL_UDF(a, b, c, d + 1) FROM x")
def test_identify(self):
assert parse_one("x").sql(identify=True) == '"x"'
assert parse_one("x").sql(identify="always") == '"x"'
assert parse_one("X").sql(identify="always") == '"X"'
assert parse_one("x").sql(identify="safe") == '"x"'
assert parse_one("X").sql(identify="safe") == "X"
assert parse_one("x as 1").sql(identify="safe") == '"x" AS "1"'
assert parse_one("X as 1").sql(identify="safe") == 'X AS "1"'