summaryrefslogtreecommitdiffstats
path: root/sqlglot/__init__.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:37 +0000
commitbe1cb18ea28222fca384a5459a024b7e9af5cadb (patch)
tree4698c9069380a7c30ceb51129f93f6c8662315e4 /sqlglot/__init__.py
parentReleasing debian version 10.5.6-1. (diff)
downloadsqlglot-be1cb18ea28222fca384a5459a024b7e9af5cadb.tar.xz
sqlglot-be1cb18ea28222fca384a5459a024b7e9af5cadb.zip
Merging upstream version 10.5.10.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/__init__.py')
-rw-r--r--sqlglot/__init__.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/sqlglot/__init__.py b/sqlglot/__init__.py
index f2db4f1..67a4463 100644
--- a/sqlglot/__init__.py
+++ b/sqlglot/__init__.py
@@ -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.