1
0
Fork 0

Merging upstream version 10.5.10.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 15:07:05 +01:00
parent 8588db6332
commit 4d496b7a6a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
43 changed files with 1384 additions and 356 deletions

View file

@ -1,5 +1,6 @@
"""
.. include:: ../README.md
----
"""
from __future__ import annotations
@ -29,14 +30,16 @@ from sqlglot.expressions import table_ as table
from sqlglot.expressions import to_column, to_table, union
from sqlglot.generator import Generator
from sqlglot.parser import Parser
from sqlglot.schema import MappingSchema
from sqlglot.schema import MappingSchema, Schema
from sqlglot.tokens import Tokenizer, TokenType
__version__ = "10.5.6"
__version__ = "10.5.10"
pretty = False
"""Whether to format generated SQL by default."""
schema = MappingSchema()
"""The default schema used by SQLGlot (e.g. in the optimizer)."""
def parse(
@ -48,7 +51,7 @@ def parse(
Args:
sql: the SQL code string to parse.
read: the SQL dialect to apply during parsing (eg. "spark", "hive", "presto", "mysql").
**opts: other options.
**opts: other `sqlglot.parser.Parser` options.
Returns:
The resulting syntax tree collection.
@ -60,7 +63,7 @@ def parse(
def parse_one(
sql: str,
read: t.Optional[str | Dialect] = None,
into: t.Optional[t.Type[Expression] | str] = None,
into: t.Optional[exp.IntoType] = None,
**opts,
) -> Expression:
"""
@ -70,7 +73,7 @@ def parse_one(
sql: the SQL code string to parse.
read: the SQL dialect to apply during parsing (eg. "spark", "hive", "presto", "mysql").
into: the SQLGlot Expression to parse into.
**opts: other options.
**opts: other `sqlglot.parser.Parser` options.
Returns:
The syntax tree for the first parsed statement.
@ -110,7 +113,7 @@ def transpile(
identity: if set to `True` and if the target dialect is not specified the source dialect will be used as both:
the source and the target dialect.
error_level: the desired error level of the parser.
**opts: other options.
**opts: other `sqlglot.generator.Generator` options.
Returns:
The list of transpiled SQL statements.