queryparser-python3 0.7.4__py3-none-any.whl → 0.8.0__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.
- queryparser/__init__.py +1 -1
- queryparser/adql/ADQLLexer.py +1006 -1003
- queryparser/adql/ADQLParser.py +1125 -1105
- queryparser/adql/ADQLParserListener.py +1 -1
- queryparser/adql/ADQLParserVisitor.py +1 -1
- queryparser/adql/adqltranslator.py +116 -62
- queryparser/mysql/MySQLLexer.py +2 -2
- queryparser/mysql/MySQLParser.py +2 -2
- queryparser/mysql/MySQLParserListener.py +1 -1
- queryparser/postgresql/PostgreSQLLexer.py +959 -946
- queryparser/postgresql/PostgreSQLParser.py +1575 -2170
- queryparser/postgresql/PostgreSQLParserListener.py +1 -82
- {queryparser_python3-0.7.4.dist-info → queryparser_python3-0.8.0.dist-info}/METADATA +12 -11
- queryparser_python3-0.8.0.dist-info/RECORD +27 -0
- {queryparser_python3-0.7.4.dist-info → queryparser_python3-0.8.0.dist-info}/WHEEL +1 -1
- queryparser/adql/adqlprocessor.py +0 -23
- queryparser_python3-0.7.4.dist-info/RECORD +0 -28
- {queryparser_python3-0.7.4.dist-info → queryparser_python3-0.8.0.dist-info}/licenses/LICENSE +0 -0
- {queryparser_python3-0.7.4.dist-info → queryparser_python3-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated from src/queryparser/postgresql/PostgreSQLParser.g4 by ANTLR 4.13.
|
|
1
|
+
# Generated from src/queryparser/postgresql/PostgreSQLParser.g4 by ANTLR 4.13.2
|
|
2
2
|
from antlr4 import *
|
|
3
3
|
if "." in __name__:
|
|
4
4
|
from .PostgreSQLParser import PostgreSQLParser
|
|
@@ -260,15 +260,6 @@ class PostgreSQLParserListener(ParseTreeListener):
|
|
|
260
260
|
pass
|
|
261
261
|
|
|
262
262
|
|
|
263
|
-
# Enter a parse tree produced by PostgreSQLParser#displayed_column_arr.
|
|
264
|
-
def enterDisplayed_column_arr(self, ctx:PostgreSQLParser.Displayed_column_arrContext):
|
|
265
|
-
pass
|
|
266
|
-
|
|
267
|
-
# Exit a parse tree produced by PostgreSQLParser#displayed_column_arr.
|
|
268
|
-
def exitDisplayed_column_arr(self, ctx:PostgreSQLParser.Displayed_column_arrContext):
|
|
269
|
-
pass
|
|
270
|
-
|
|
271
|
-
|
|
272
263
|
# Enter a parse tree produced by PostgreSQLParser#exp_factor1.
|
|
273
264
|
def enterExp_factor1(self, ctx:PostgreSQLParser.Exp_factor1Context):
|
|
274
265
|
pass
|
|
@@ -845,78 +836,6 @@ class PostgreSQLParserListener(ParseTreeListener):
|
|
|
845
836
|
pass
|
|
846
837
|
|
|
847
838
|
|
|
848
|
-
# Enter a parse tree produced by PostgreSQLParser#spoint_to_array.
|
|
849
|
-
def enterSpoint_to_array(self, ctx:PostgreSQLParser.Spoint_to_arrayContext):
|
|
850
|
-
pass
|
|
851
|
-
|
|
852
|
-
# Exit a parse tree produced by PostgreSQLParser#spoint_to_array.
|
|
853
|
-
def exitSpoint_to_array(self, ctx:PostgreSQLParser.Spoint_to_arrayContext):
|
|
854
|
-
pass
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
# Enter a parse tree produced by PostgreSQLParser#spoint_to_array_deg.
|
|
858
|
-
def enterSpoint_to_array_deg(self, ctx:PostgreSQLParser.Spoint_to_array_degContext):
|
|
859
|
-
pass
|
|
860
|
-
|
|
861
|
-
# Exit a parse tree produced by PostgreSQLParser#spoint_to_array_deg.
|
|
862
|
-
def exitSpoint_to_array_deg(self, ctx:PostgreSQLParser.Spoint_to_array_degContext):
|
|
863
|
-
pass
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
# Enter a parse tree produced by PostgreSQLParser#sbox_to_array.
|
|
867
|
-
def enterSbox_to_array(self, ctx:PostgreSQLParser.Sbox_to_arrayContext):
|
|
868
|
-
pass
|
|
869
|
-
|
|
870
|
-
# Exit a parse tree produced by PostgreSQLParser#sbox_to_array.
|
|
871
|
-
def exitSbox_to_array(self, ctx:PostgreSQLParser.Sbox_to_arrayContext):
|
|
872
|
-
pass
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
# Enter a parse tree produced by PostgreSQLParser#sbox_to_array_deg.
|
|
876
|
-
def enterSbox_to_array_deg(self, ctx:PostgreSQLParser.Sbox_to_array_degContext):
|
|
877
|
-
pass
|
|
878
|
-
|
|
879
|
-
# Exit a parse tree produced by PostgreSQLParser#sbox_to_array_deg.
|
|
880
|
-
def exitSbox_to_array_deg(self, ctx:PostgreSQLParser.Sbox_to_array_degContext):
|
|
881
|
-
pass
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
# Enter a parse tree produced by PostgreSQLParser#scircle_to_array.
|
|
885
|
-
def enterScircle_to_array(self, ctx:PostgreSQLParser.Scircle_to_arrayContext):
|
|
886
|
-
pass
|
|
887
|
-
|
|
888
|
-
# Exit a parse tree produced by PostgreSQLParser#scircle_to_array.
|
|
889
|
-
def exitScircle_to_array(self, ctx:PostgreSQLParser.Scircle_to_arrayContext):
|
|
890
|
-
pass
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
# Enter a parse tree produced by PostgreSQLParser#scircle_to_array_deg.
|
|
894
|
-
def enterScircle_to_array_deg(self, ctx:PostgreSQLParser.Scircle_to_array_degContext):
|
|
895
|
-
pass
|
|
896
|
-
|
|
897
|
-
# Exit a parse tree produced by PostgreSQLParser#scircle_to_array_deg.
|
|
898
|
-
def exitScircle_to_array_deg(self, ctx:PostgreSQLParser.Scircle_to_array_degContext):
|
|
899
|
-
pass
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
# Enter a parse tree produced by PostgreSQLParser#spoly_to_array.
|
|
903
|
-
def enterSpoly_to_array(self, ctx:PostgreSQLParser.Spoly_to_arrayContext):
|
|
904
|
-
pass
|
|
905
|
-
|
|
906
|
-
# Exit a parse tree produced by PostgreSQLParser#spoly_to_array.
|
|
907
|
-
def exitSpoly_to_array(self, ctx:PostgreSQLParser.Spoly_to_arrayContext):
|
|
908
|
-
pass
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
# Enter a parse tree produced by PostgreSQLParser#spoly_to_array_deg.
|
|
912
|
-
def enterSpoly_to_array_deg(self, ctx:PostgreSQLParser.Spoly_to_array_degContext):
|
|
913
|
-
pass
|
|
914
|
-
|
|
915
|
-
# Exit a parse tree produced by PostgreSQLParser#spoly_to_array_deg.
|
|
916
|
-
def exitSpoly_to_array_deg(self, ctx:PostgreSQLParser.Spoly_to_array_degContext):
|
|
917
|
-
pass
|
|
918
|
-
|
|
919
|
-
|
|
920
839
|
# Enter a parse tree produced by PostgreSQLParser#pg_sphere_object.
|
|
921
840
|
def enterPg_sphere_object(self, ctx:PostgreSQLParser.Pg_sphere_objectContext):
|
|
922
841
|
pass
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: queryparser-python3
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Package for parsing PostgreSQL/MySQL and translating ADQL to PostgreSQL/MySQL.
|
|
5
|
-
Author-email: Gal Matijevic <gmatijevic@aip.de>
|
|
6
|
-
Maintainer-email: Kirill Makan <kmakan@aip.de
|
|
5
|
+
Author-email: Kirill Makan <kmakan@aip.de>, Gal Matijevic <gmatijevic@aip.de>
|
|
6
|
+
Maintainer-email: Kirill Makan <kmakan@aip.de>
|
|
7
7
|
License: Apache-2.0
|
|
8
8
|
Project-URL: Repository, https://github.com/aipescience/queryparser.git
|
|
9
9
|
Project-URL: Issues, https://github.com/aipescience/queryparser/issues
|
|
@@ -17,10 +17,12 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
22
|
Requires-Python: >=3.9
|
|
21
23
|
Description-Content-Type: text/markdown
|
|
22
24
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: antlr4-python3-runtime==4.13.
|
|
25
|
+
Requires-Dist: antlr4-python3-runtime==4.13.2
|
|
24
26
|
Provides-Extra: test
|
|
25
27
|
Requires-Dist: pytest~=8.2.0; extra == "test"
|
|
26
28
|
Requires-Dist: PyYAML~=6.0; extra == "test"
|
|
@@ -74,7 +76,7 @@ To generate the parsers you need `python3` , `java` above version
|
|
|
74
76
|
The current version of `antlr-4.*-complete.jar` can be downloaded via
|
|
75
77
|
|
|
76
78
|
```bash
|
|
77
|
-
wget http://www.antlr.org/download/antlr-4.13.
|
|
79
|
+
wget http://www.antlr.org/download/antlr-4.13.2-complete.jar
|
|
78
80
|
```
|
|
79
81
|
|
|
80
82
|
After cloning the project run
|
|
@@ -95,9 +97,9 @@ to install the generated parser in your virtual environment.
|
|
|
95
97
|
Additional requirements
|
|
96
98
|
-----------------------
|
|
97
99
|
The queryparser assumes that the PostgreSQL database has the extension
|
|
98
|
-
[pg_sphere](https://github.com/
|
|
99
|
-
Although
|
|
100
|
-
**queries will not run** without this extension installed
|
|
100
|
+
[pg_sphere](https://github.com/postgrespro/pgsphere) installed.
|
|
101
|
+
Although `pg_sphere` is not required for the Python module, PostgreSQL
|
|
102
|
+
**queries will not run** without this extension installed in the database.
|
|
101
103
|
|
|
102
104
|
|
|
103
105
|
Parsing MySQL and PostgreSQL
|
|
@@ -152,7 +154,7 @@ the `ADQLQueryTranslator` class
|
|
|
152
154
|
|
|
153
155
|
```python
|
|
154
156
|
from queryparser.adql import ADQLQueryTranslator
|
|
155
|
-
adql = "SELECT TOP 100 POINT('ICRS', ra,
|
|
157
|
+
adql = "SELECT TOP 100 POINT('ICRS', ra, dec) FROM db.tab;"
|
|
156
158
|
adt = ADQLQueryTranslator(adql)
|
|
157
159
|
```
|
|
158
160
|
|
|
@@ -162,7 +164,7 @@ and calling
|
|
|
162
164
|
adt.to_postgresql()
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
which returns a translated string representing a valid
|
|
167
|
+
which returns a translated string representing a valid PostgreSQL query if
|
|
166
168
|
the ADQL query had no errors. The PostgreSQL query can then be parsed with the
|
|
167
169
|
`PostgreSQLQueryProcessor` in the same way as shown above.
|
|
168
170
|
|
|
@@ -181,4 +183,3 @@ then run the test suite with
|
|
|
181
183
|
```bash
|
|
182
184
|
python -m pytest lib/
|
|
183
185
|
```
|
|
184
|
-
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
queryparser/__init__.py,sha256=27YY3zFpeaDh6JoC40AqkjBrn68SqFlsWZzjZtw5jwU,22
|
|
2
|
+
queryparser/adql/ADQLLexer.py,sha256=jD1vxDO7tyTcMof-mtFZUkQJyO6nI9MpcuX2MTmO9FA,90067
|
|
3
|
+
queryparser/adql/ADQLParser.py,sha256=jC-MaX1am4hBAsjAFNDbFtdvY5T6lBqfS7aD97LxM8o,371730
|
|
4
|
+
queryparser/adql/ADQLParserListener.py,sha256=3IDrIeWeON2l4g2onCOChqeGWMMTzpX6sPYH58HeK_s,39836
|
|
5
|
+
queryparser/adql/ADQLParserVisitor.py,sha256=ZWKDOagjsXYQll8vCOYHDNyaYExtKNaZce2ysEBFXtI,23612
|
|
6
|
+
queryparser/adql/__init__.py,sha256=QjRobun31YF-F8qf66RtwjRgRgRiQjLIao4jaIE5Lv8,108
|
|
7
|
+
queryparser/adql/adqltranslator.py,sha256=C4YmwmJ7PyL8agJb3xOYe-qE_nOeKVwvWqSLO371Y3o,27171
|
|
8
|
+
queryparser/common/__init__.py,sha256=k1jnIaxY1TYG8dVXokbsT9Q56msjKRfOSTPEhWbo3GE,214
|
|
9
|
+
queryparser/common/common.py,sha256=DTX0PXHUvbU5YboXcFrvE18qx5-vOdqx9Hji_m5ts7o,38098
|
|
10
|
+
queryparser/exceptions/__init__.py,sha256=zVJsC5p3_CfpC0wDdVbS0-HLIbRGz6-xMa5K5_qX82A,247
|
|
11
|
+
queryparser/mysql/MySQLLexer.py,sha256=SbvjiiLzlJoY1vTFjPwTb3yjsyKxvtcp2iQj3GjKawM,339457
|
|
12
|
+
queryparser/mysql/MySQLParser.py,sha256=FnvxYOYU02MybczLPtI9hpYHtP2U0ELq9LSZyr95XMQ,320949
|
|
13
|
+
queryparser/mysql/MySQLParserListener.py,sha256=9F4ezIzQfzdMTCFSji8-cwWK1T_yTHOtpS73IiiVGLc,24025
|
|
14
|
+
queryparser/mysql/__init__.py,sha256=eH7URYmOEqLxyZyZV2L60UH6qsFQXD4-SjIzyzI13o0,108
|
|
15
|
+
queryparser/mysql/mysqllisteners.py,sha256=D-W-p7QO6-eQDWO-mg-WbAOyodZ6-VU79hg1mvvxWbY,67
|
|
16
|
+
queryparser/mysql/mysqlprocessor.py,sha256=iF9CUUm3Hnw_mkmp3ncaXc_iAd48pr6WM0p0Tmn4Vnw,648
|
|
17
|
+
queryparser/postgresql/PostgreSQLLexer.py,sha256=wnAQV8_D9dY30JRxjELzJH1DhIqjaLczU329vJjet90,78109
|
|
18
|
+
queryparser/postgresql/PostgreSQLParser.py,sha256=xkdEaquII1tJGJutDNw3NucNByeKPAgD4C7aQnT9arU,312349
|
|
19
|
+
queryparser/postgresql/PostgreSQLParserListener.py,sha256=cW7hf9qn11X8BZDQsiTto1UxXabmApl-PC99rPbFthY,29247
|
|
20
|
+
queryparser/postgresql/__init__.py,sha256=Y06UttOdTusJH1hHDdmm1XOwNP1K03c7K1iNJrh7Yyw,123
|
|
21
|
+
queryparser/postgresql/postgresqllisteners.py,sha256=wCyqDsNPQ2Hl0odXy-ZZmI3HB_6CY7LvwkQDogOLONg,72
|
|
22
|
+
queryparser/postgresql/postgresqlprocessor.py,sha256=x5qG9A93oGx9hnarnFIevJ1WNBhjc8Ao6v_bizmVpIw,702
|
|
23
|
+
queryparser_python3-0.8.0.dist-info/licenses/LICENSE,sha256=oRiVx4r69ZT4QO-yy0V8lx8xhGm_OudJKSjd-Q6NL9Q,25853
|
|
24
|
+
queryparser_python3-0.8.0.dist-info/METADATA,sha256=Rbm47NKwrLi5i_ZunofV_TZEulLx7hv0EhsoaAZMpWo,5784
|
|
25
|
+
queryparser_python3-0.8.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
26
|
+
queryparser_python3-0.8.0.dist-info/top_level.txt,sha256=SsQ3yI4UEjGsc6tHaZTmHTdvhAk4Itp5BGQ-J-zvx7U,12
|
|
27
|
+
queryparser_python3-0.8.0.dist-info/RECORD,,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
ADQL processor. Its task is to check if a query has any syntax errors and
|
|
4
|
-
to extract all accessed columns as well as keywords and functions being
|
|
5
|
-
used in a query.
|
|
6
|
-
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import absolute_import, print_function
|
|
10
|
-
|
|
11
|
-
__all__ = ["ADQLQueryProcessor"]
|
|
12
|
-
|
|
13
|
-
from ..common import SQLQueryProcessor
|
|
14
|
-
from .ADQLLexer import ADQLLexer
|
|
15
|
-
from .ADQLParser import ADQLParser
|
|
16
|
-
from .ADQLParserListener import ADQLParserListener
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class ADQLQueryProcessor(SQLQueryProcessor):
|
|
20
|
-
def __init__(self, query=None):
|
|
21
|
-
super().__init__(
|
|
22
|
-
ADQLLexer, ADQLParser, ADQLParserListener, '"', query
|
|
23
|
-
)
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
queryparser/__init__.py,sha256=lBlBxbnftiADKPpC3XRA3jUPjRsVclCd3P95aQ33p_g,22
|
|
2
|
-
queryparser/adql/ADQLLexer.py,sha256=JVQ_TseEuYMaNr3kHBw50oKMuu4Au1vWak8u1dQAavs,89907
|
|
3
|
-
queryparser/adql/ADQLParser.py,sha256=_kswLJMJIR9EwMhpS17xRC2hcSZo8O1ygkXlHc7Vd0s,370976
|
|
4
|
-
queryparser/adql/ADQLParserListener.py,sha256=V80PMXEy6hoQMwRqExOFRvJocH2eBIdR3BbxW1t14Dk,39836
|
|
5
|
-
queryparser/adql/ADQLParserVisitor.py,sha256=YpDeQorBMJG4AWeBQk7Gxdijmf302WuY83iWu5taOZo,23612
|
|
6
|
-
queryparser/adql/__init__.py,sha256=QjRobun31YF-F8qf66RtwjRgRgRiQjLIao4jaIE5Lv8,108
|
|
7
|
-
queryparser/adql/adqlprocessor.py,sha256=-ORsp0Oyt5ppzcm6N_eYA0wV_wt8hRdvhs2Ex42zhQc,630
|
|
8
|
-
queryparser/adql/adqltranslator.py,sha256=TWIgdWozd5eMSZMgycwJJ48kBi1PX2XCc7UHzgEKTVM,25514
|
|
9
|
-
queryparser/common/__init__.py,sha256=k1jnIaxY1TYG8dVXokbsT9Q56msjKRfOSTPEhWbo3GE,214
|
|
10
|
-
queryparser/common/common.py,sha256=DTX0PXHUvbU5YboXcFrvE18qx5-vOdqx9Hji_m5ts7o,38098
|
|
11
|
-
queryparser/exceptions/__init__.py,sha256=zVJsC5p3_CfpC0wDdVbS0-HLIbRGz6-xMa5K5_qX82A,247
|
|
12
|
-
queryparser/mysql/MySQLLexer.py,sha256=spBkNK5d1cgpAeCxYaw7E3lhFI1qAlx5q40pO2MyLXA,339457
|
|
13
|
-
queryparser/mysql/MySQLParser.py,sha256=moVPn_tOYGWKBuMJqioeb3KkF4cnx31xGGRkv9uyeZI,320949
|
|
14
|
-
queryparser/mysql/MySQLParserListener.py,sha256=c6YPErBcvas9gxg62y5ZYW82eGfT4r7a1ewzoWaFt-Y,24025
|
|
15
|
-
queryparser/mysql/__init__.py,sha256=eH7URYmOEqLxyZyZV2L60UH6qsFQXD4-SjIzyzI13o0,108
|
|
16
|
-
queryparser/mysql/mysqllisteners.py,sha256=D-W-p7QO6-eQDWO-mg-WbAOyodZ6-VU79hg1mvvxWbY,67
|
|
17
|
-
queryparser/mysql/mysqlprocessor.py,sha256=iF9CUUm3Hnw_mkmp3ncaXc_iAd48pr6WM0p0Tmn4Vnw,648
|
|
18
|
-
queryparser/postgresql/PostgreSQLLexer.py,sha256=vza2Kl2aLCD9CGBaAcer3G1Oohqac7kuf9dlNKfS5AQ,77264
|
|
19
|
-
queryparser/postgresql/PostgreSQLParser.py,sha256=S7dmeLBVCiLIafBwwHsjGvJQ5i3XotyS1ufrq0a1BFU,333042
|
|
20
|
-
queryparser/postgresql/PostgreSQLParserListener.py,sha256=s6nN_aiPJnawUZS5yRDg_sBWo36RAGnB2OK5KMhKOAo,32328
|
|
21
|
-
queryparser/postgresql/__init__.py,sha256=Y06UttOdTusJH1hHDdmm1XOwNP1K03c7K1iNJrh7Yyw,123
|
|
22
|
-
queryparser/postgresql/postgresqllisteners.py,sha256=wCyqDsNPQ2Hl0odXy-ZZmI3HB_6CY7LvwkQDogOLONg,72
|
|
23
|
-
queryparser/postgresql/postgresqlprocessor.py,sha256=x5qG9A93oGx9hnarnFIevJ1WNBhjc8Ao6v_bizmVpIw,702
|
|
24
|
-
queryparser_python3-0.7.4.dist-info/licenses/LICENSE,sha256=oRiVx4r69ZT4QO-yy0V8lx8xhGm_OudJKSjd-Q6NL9Q,25853
|
|
25
|
-
queryparser_python3-0.7.4.dist-info/METADATA,sha256=NAKUR-tyhuO6IvqxvQvUdOFMAr-3eYYQ-3NhoVmB8NA,5699
|
|
26
|
-
queryparser_python3-0.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
-
queryparser_python3-0.7.4.dist-info/top_level.txt,sha256=SsQ3yI4UEjGsc6tHaZTmHTdvhAk4Itp5BGQ-J-zvx7U,12
|
|
28
|
-
queryparser_python3-0.7.4.dist-info/RECORD,,
|
{queryparser_python3-0.7.4.dist-info → queryparser_python3-0.8.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|