queryparser-python3 0.6.1__py3-none-any.whl → 0.7.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.
- queryparser/__init__.py +1 -9
- queryparser/adql/ADQLLexer.py +1296 -1328
- queryparser/adql/ADQLParser.py +2089 -2186
- queryparser/adql/ADQLParserListener.py +38 -56
- queryparser/adql/ADQLParserVisitor.py +22 -32
- queryparser/adql/adqltranslator.py +206 -74
- queryparser/common/common.py +1 -36
- queryparser/mysql/MySQLLexer.py +2 -2
- queryparser/mysql/MySQLParser.py +201 -212
- queryparser/mysql/MySQLParserListener.py +2 -2
- queryparser/postgresql/PostgreSQLLexer.py +880 -792
- queryparser/postgresql/PostgreSQLParser.py +2155 -1522
- queryparser/postgresql/PostgreSQLParserListener.py +83 -2
- queryparser/postgresql/postgresqllisteners.py +2 -50
- queryparser/postgresql/postgresqlprocessor.py +1 -4
- queryparser_python3-0.7.1.dist-info/METADATA +180 -0
- queryparser_python3-0.7.1.dist-info/RECORD +27 -0
- {queryparser_python3-0.6.1.dist-info → queryparser_python3-0.7.1.dist-info}/WHEEL +1 -1
- queryparser_python3-0.6.1.dist-info/METADATA +0 -152
- queryparser_python3-0.6.1.dist-info/RECORD +0 -27
- {queryparser_python3-0.6.1.dist-info → queryparser_python3-0.7.1.dist-info/licenses}/LICENSE +0 -0
- {queryparser_python3-0.6.1.dist-info → queryparser_python3-0.7.1.dist-info}/top_level.txt +0 -0
queryparser/common/common.py
CHANGED
|
@@ -734,15 +734,7 @@ class SQLQueryProcessor(object):
|
|
|
734
734
|
:param replace_schema_name:
|
|
735
735
|
A new schema name to be put in place of the original.
|
|
736
736
|
|
|
737
|
-
:param indexed_objects:
|
|
738
|
-
A dictionary defining pgsphere objects to be replaced with
|
|
739
|
-
precomputed (on the database level) columns. For example,
|
|
740
|
-
|
|
741
|
-
iob = {'spoint': ((('gdr2', 'gaia_source', 'ra'),
|
|
742
|
-
('gdr2', 'gaia_source', 'dec'), 'pos'),)}
|
|
743
|
-
|
|
744
|
-
will replace 'spoint(RADIANS(ra), RADIANS(dec))' with a 'pos'
|
|
745
|
-
column.
|
|
737
|
+
:param indexed_objects: Deprecated
|
|
746
738
|
|
|
747
739
|
"""
|
|
748
740
|
# Antlr objects
|
|
@@ -893,14 +885,6 @@ class SQLQueryProcessor(object):
|
|
|
893
885
|
for i in mc])
|
|
894
886
|
raise QueryError("Unreferenced column(s): '%s'." % unref_cols)
|
|
895
887
|
|
|
896
|
-
# If we have indexed_objects, we are also accessing those. We
|
|
897
|
-
# need to add them into the columns stack:
|
|
898
|
-
if indexed_objects is not None:
|
|
899
|
-
for k, v in indexed_objects.items():
|
|
900
|
-
for vals in v:
|
|
901
|
-
touched_columns.append([[vals[0][0], vals[0][1], vals[2],
|
|
902
|
-
None], None])
|
|
903
|
-
|
|
904
888
|
touched_columns = set([tuple(i[0]) for i in touched_columns])
|
|
905
889
|
|
|
906
890
|
# extract display_columns
|
|
@@ -942,25 +926,6 @@ class SQLQueryProcessor(object):
|
|
|
942
926
|
if i[0][1] is not None else i[0][1]])
|
|
943
927
|
for i in tables]))
|
|
944
928
|
|
|
945
|
-
# If there are any sphere-like objects (pgsphere...) that are indexed
|
|
946
|
-
# we need to replace the ADQL translated query parts with the indexed
|
|
947
|
-
# column names
|
|
948
|
-
if indexed_objects is not None and self.sphere_listener is not None:
|
|
949
|
-
# we need to correctly alias 'pos' columns
|
|
950
|
-
for k, v in indexed_objects.items():
|
|
951
|
-
indexed_objects[k] = list([list(i) for i in v])
|
|
952
|
-
for i, vals in enumerate(v):
|
|
953
|
-
for t in tables:
|
|
954
|
-
if vals[0][0] == t[0][0] and vals[0][1] == t[0][1] and\
|
|
955
|
-
t[1] is not None:
|
|
956
|
-
indexed_objects[k][i][2] = t[1] + '.' +\
|
|
957
|
-
indexed_objects[k][i][2]
|
|
958
|
-
|
|
959
|
-
sphere_listener = self.sphere_listener(columns, indexed_objects)
|
|
960
|
-
self.walker.walk(sphere_listener, tree)
|
|
961
|
-
for k, v in sphere_listener.replace_dict.items():
|
|
962
|
-
self._query = self._query.replace(k, v)
|
|
963
|
-
|
|
964
929
|
@property
|
|
965
930
|
def query(self):
|
|
966
931
|
"""
|
queryparser/mysql/MySQLLexer.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated from src/queryparser/mysql/MySQLLexer.g4 by ANTLR 4.
|
|
1
|
+
# Generated from src/queryparser/mysql/MySQLLexer.g4 by ANTLR 4.13.1
|
|
2
2
|
from antlr4 import *
|
|
3
3
|
from io import StringIO
|
|
4
4
|
import sys
|
|
@@ -4984,7 +4984,7 @@ class MySQLLexer(Lexer):
|
|
|
4984
4984
|
|
|
4985
4985
|
def __init__(self, input=None, output:TextIO = sys.stdout):
|
|
4986
4986
|
super().__init__(input, output)
|
|
4987
|
-
self.checkVersion("4.
|
|
4987
|
+
self.checkVersion("4.13.1")
|
|
4988
4988
|
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
|
|
4989
4989
|
self._actions = None
|
|
4990
4990
|
self._predicates = None
|