sqlglot 27.6.0__py3-none-any.whl → 27.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlglot/__init__.py +1 -0
- sqlglot/_version.py +16 -3
- sqlglot/expressions.py +20 -0
- {sqlglot-27.6.0.dist-info → sqlglot-27.6.1.dist-info}/METADATA +1 -1
- {sqlglot-27.6.0.dist-info → sqlglot-27.6.1.dist-info}/RECORD +8 -8
- {sqlglot-27.6.0.dist-info → sqlglot-27.6.1.dist-info}/WHEEL +0 -0
- {sqlglot-27.6.0.dist-info → sqlglot-27.6.1.dist-info}/licenses/LICENSE +0 -0
- {sqlglot-27.6.0.dist-info → sqlglot-27.6.1.dist-info}/top_level.txt +0 -0
sqlglot/__init__.py
CHANGED
sqlglot/_version.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
3
|
|
|
4
|
-
__all__ = [
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
5
12
|
|
|
6
13
|
TYPE_CHECKING = False
|
|
7
14
|
if TYPE_CHECKING:
|
|
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
|
|
|
9
16
|
from typing import Union
|
|
10
17
|
|
|
11
18
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
12
20
|
else:
|
|
13
21
|
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
14
23
|
|
|
15
24
|
version: str
|
|
16
25
|
__version__: str
|
|
17
26
|
__version_tuple__: VERSION_TUPLE
|
|
18
27
|
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
19
30
|
|
|
20
|
-
__version__ = version = '27.6.
|
|
21
|
-
__version_tuple__ = version_tuple = (27, 6,
|
|
31
|
+
__version__ = version = '27.6.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (27, 6, 1)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
sqlglot/expressions.py
CHANGED
|
@@ -8624,6 +8624,26 @@ def replace_tree(
|
|
|
8624
8624
|
return new_node
|
|
8625
8625
|
|
|
8626
8626
|
|
|
8627
|
+
def find_tables(expression: Expression) -> t.Set[Table]:
|
|
8628
|
+
"""
|
|
8629
|
+
Find all tables referenced in a query.
|
|
8630
|
+
|
|
8631
|
+
Args:
|
|
8632
|
+
expressions: The query to find the tables in.
|
|
8633
|
+
|
|
8634
|
+
Returns:
|
|
8635
|
+
A set of all the tables.
|
|
8636
|
+
"""
|
|
8637
|
+
from sqlglot.optimizer.scope import traverse_scope
|
|
8638
|
+
|
|
8639
|
+
return {
|
|
8640
|
+
table
|
|
8641
|
+
for scope in traverse_scope(expression)
|
|
8642
|
+
for table in scope.tables
|
|
8643
|
+
if table.name and table.name not in scope.cte_sources
|
|
8644
|
+
}
|
|
8645
|
+
|
|
8646
|
+
|
|
8627
8647
|
def column_table_names(expression: Expression, exclude: str = "") -> t.Set[str]:
|
|
8628
8648
|
"""
|
|
8629
8649
|
Return all table names referenced through columns in an expression.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
sqlglot/__init__.py,sha256=
|
|
1
|
+
sqlglot/__init__.py,sha256=XtHbbz93ughtCoKNYTbB8UftQvN5Bzt8fJZcD09ZcM8,5423
|
|
2
2
|
sqlglot/__main__.py,sha256=022c173KqxsiABWTEpUIq_tJUxuNiW7a7ABsxBXqvu8,2069
|
|
3
3
|
sqlglot/_typing.py,sha256=-1HPyr3w5COlSJWqlgt8jhFk2dyMvBuvVBqIX1wyVCM,642
|
|
4
|
-
sqlglot/_version.py,sha256=
|
|
4
|
+
sqlglot/_version.py,sha256=HWhnLcS8AiG1fzYyZ19-OOM59GAdOd4gi1uzXLPWzoc,706
|
|
5
5
|
sqlglot/diff.py,sha256=PtOllQMQa1Sw1-V2Y8eypmDqGujXYPaTOp_WLsWkAWk,17314
|
|
6
6
|
sqlglot/errors.py,sha256=QNKMr-pzLUDR-tuMmn_GK6iMHUIVdb_YSJ_BhGEvuso,2126
|
|
7
|
-
sqlglot/expressions.py,sha256=
|
|
7
|
+
sqlglot/expressions.py,sha256=eGh8CEbjw9Oyo2IsdGgsvcZ1SwtkfxoIe2Z44y7o0Xk,246738
|
|
8
8
|
sqlglot/generator.py,sha256=Xfbpm-z9NdxZPWdaTeMRJ2ton0H_y5wfC6j3dwgouQQ,218351
|
|
9
9
|
sqlglot/helper.py,sha256=9nZjFVRBtMKFC3EdzpDQ6jkazFO19po6BF8xHiNGZIo,15111
|
|
10
10
|
sqlglot/jsonpath.py,sha256=jneO-A57n4ojVT2drCn2HBlx_Ka8wLcGpemW1JgvbjA,7666
|
|
@@ -76,8 +76,8 @@ sqlglot/optimizer/qualify_tables.py,sha256=rRo0rXMMDAloG_ut7nGPtIO3e__ooM2PqShxW
|
|
|
76
76
|
sqlglot/optimizer/scope.py,sha256=T6iVYnYwubt-WB1BOFsFYdJ-D7WtWZGL37SuCRQK23s,31154
|
|
77
77
|
sqlglot/optimizer/simplify.py,sha256=-_yus42OYwqjQ9a2TSGhtG2G0pSkInUry1z7hEMz2pY,51062
|
|
78
78
|
sqlglot/optimizer/unnest_subqueries.py,sha256=kzWUVDlxs8z9nmRx-8U-pHXPtVZhEIwkKqmKhr2QLvc,10908
|
|
79
|
-
sqlglot-27.6.
|
|
80
|
-
sqlglot-27.6.
|
|
81
|
-
sqlglot-27.6.
|
|
82
|
-
sqlglot-27.6.
|
|
83
|
-
sqlglot-27.6.
|
|
79
|
+
sqlglot-27.6.1.dist-info/licenses/LICENSE,sha256=p1Yk0B4oa0l8Rh-_dYyy75d8spjPd_vTloXfz4FWxys,1065
|
|
80
|
+
sqlglot-27.6.1.dist-info/METADATA,sha256=284xsaLjHfNx6p_D-H-ocV0oUrsyKun0CS8vEMVktk0,19437
|
|
81
|
+
sqlglot-27.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
82
|
+
sqlglot-27.6.1.dist-info/top_level.txt,sha256=5kRskCGA_gVADF9rSfSzPdLHXqvfMusDYeHePfNY2nQ,8
|
|
83
|
+
sqlglot-27.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|