sqlglot 26.25.0__py3-none-any.whl → 26.25.2__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/_version.py +2 -2
- sqlglot/dialects/postgres.py +7 -5
- {sqlglot-26.25.0.dist-info → sqlglot-26.25.2.dist-info}/METADATA +2 -2
- {sqlglot-26.25.0.dist-info → sqlglot-26.25.2.dist-info}/RECORD +7 -7
- {sqlglot-26.25.0.dist-info → sqlglot-26.25.2.dist-info}/WHEEL +0 -0
- {sqlglot-26.25.0.dist-info → sqlglot-26.25.2.dist-info}/licenses/LICENSE +0 -0
- {sqlglot-26.25.0.dist-info → sqlglot-26.25.2.dist-info}/top_level.txt +0 -0
sqlglot/_version.py
CHANGED
sqlglot/dialects/postgres.py
CHANGED
@@ -13,6 +13,7 @@ from sqlglot.dialects.dialect import (
|
|
13
13
|
datestrtodate_sql,
|
14
14
|
build_formatted_time,
|
15
15
|
filter_array_using_unnest,
|
16
|
+
inline_array_sql,
|
16
17
|
json_extract_segments,
|
17
18
|
json_path_key_only_name,
|
18
19
|
max_or_greatest,
|
@@ -728,11 +729,12 @@ class Postgres(Dialect):
|
|
728
729
|
|
729
730
|
def array_sql(self, expression: exp.Array) -> str:
|
730
731
|
exprs = expression.expressions
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
732
|
+
func_name = self.normalize_func("ARRAY")
|
733
|
+
|
734
|
+
if isinstance(seq_get(exprs, 0), exp.Select):
|
735
|
+
return f"{func_name}({self.sql(exprs[0])})"
|
736
|
+
|
737
|
+
return f"{func_name}{inline_array_sql(self, expression)}"
|
736
738
|
|
737
739
|
def computedcolumnconstraint_sql(self, expression: exp.ComputedColumnConstraint) -> str:
|
738
740
|
return f"GENERATED ALWAYS AS ({self.sql(expression, 'this')}) STORED"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sqlglot
|
3
|
-
Version: 26.25.
|
3
|
+
Version: 26.25.2
|
4
4
|
Summary: An easily customizable SQL parser and transpiler
|
5
5
|
Author-email: Toby Mao <toby.mao@gmail.com>
|
6
6
|
License: MIT License
|
@@ -55,7 +55,7 @@ Requires-Dist: typing_extensions; extra == "dev"
|
|
55
55
|
Requires-Dist: maturin<2.0,>=1.4; extra == "dev"
|
56
56
|
Requires-Dist: pyperf; extra == "dev"
|
57
57
|
Provides-Extra: rs
|
58
|
-
Requires-Dist: sqlglotrs==0.6.
|
58
|
+
Requires-Dist: sqlglotrs==0.6.1; extra == "rs"
|
59
59
|
Dynamic: license-file
|
60
60
|
Dynamic: provides-extra
|
61
61
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
sqlglot/__init__.py,sha256=za08rtdPh2v7dOpGdNomttlIVGgTrKja7rPd6sQwaTg,5391
|
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=evrbUeuB7Ow_C403uFi51YSjYHW6RFMOvMP7ncGfqTE,515
|
5
5
|
sqlglot/diff.py,sha256=PtOllQMQa1Sw1-V2Y8eypmDqGujXYPaTOp_WLsWkAWk,17314
|
6
6
|
sqlglot/errors.py,sha256=QNKMr-pzLUDR-tuMmn_GK6iMHUIVdb_YSJ_BhGEvuso,2126
|
7
7
|
sqlglot/expressions.py,sha256=uyRDFl1k--uVrVAhY0zu54tn49a5adE6n7C8RpnahEc,242084
|
@@ -33,7 +33,7 @@ sqlglot/dialects/hive.py,sha256=IKAM2elf_n3LgRcPK_4-JuE1j6shd6FhE1QJvBaP55U,3166
|
|
33
33
|
sqlglot/dialects/materialize.py,sha256=_DPLPt8YrdQIIXNrGJw1IMcGOoAEJ9NO9X9pDfy4hxs,3494
|
34
34
|
sqlglot/dialects/mysql.py,sha256=PnhqX2B15J71WUROefPTc7ZOP0vybbkZGWIDrxYN5Dc,48159
|
35
35
|
sqlglot/dialects/oracle.py,sha256=llxu2LzndrsGyceTod-Leh03vuPWEUKzVHB5gQY-tY8,15313
|
36
|
-
sqlglot/dialects/postgres.py,sha256=
|
36
|
+
sqlglot/dialects/postgres.py,sha256=ysZCX-_gd3wVVUzT05D-zgXlPy19jAdorVsVr6NEVtA,30212
|
37
37
|
sqlglot/dialects/presto.py,sha256=ltKbQ44efeq1HM0T8Qq0rsBSx6B6bF9RoKtUBVeoz70,33155
|
38
38
|
sqlglot/dialects/prql.py,sha256=OF2LfDb4uzKIF7kpCfpL5G7VP1pnzLbjfW5QFUnuPvo,7803
|
39
39
|
sqlglot/dialects/redshift.py,sha256=H8H8lGizHIAd4qLoPeFchyiGZKO1I8U_B058woukuGw,15366
|
@@ -72,8 +72,8 @@ sqlglot/optimizer/qualify_tables.py,sha256=5f5enBAh-bpNB9ewF97W9fx9h1TGXj1Ih5fnc
|
|
72
72
|
sqlglot/optimizer/scope.py,sha256=Fqz9GpBqO1GWzRAnqdflXXNz44ot_1JqVBC-DnYAU_E,30063
|
73
73
|
sqlglot/optimizer/simplify.py,sha256=S0Blqg5Mq2KRRWhWz-Eivch9sBjBhg9fRJA6EdBzj2g,50704
|
74
74
|
sqlglot/optimizer/unnest_subqueries.py,sha256=kzWUVDlxs8z9nmRx-8U-pHXPtVZhEIwkKqmKhr2QLvc,10908
|
75
|
-
sqlglot-26.25.
|
76
|
-
sqlglot-26.25.
|
77
|
-
sqlglot-26.25.
|
78
|
-
sqlglot-26.25.
|
79
|
-
sqlglot-26.25.
|
75
|
+
sqlglot-26.25.2.dist-info/licenses/LICENSE,sha256=AI3__mHZfOtzY3EluR_pIYBm3_pE7TbVx7qaHxoZ114,1065
|
76
|
+
sqlglot-26.25.2.dist-info/METADATA,sha256=PXQmtWcXH8fwnGTN_OmfuVePGU0Jjj-QtVF6r8dbuhE,20692
|
77
|
+
sqlglot-26.25.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
78
|
+
sqlglot-26.25.2.dist-info/top_level.txt,sha256=5kRskCGA_gVADF9rSfSzPdLHXqvfMusDYeHePfNY2nQ,8
|
79
|
+
sqlglot-26.25.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|