sqlscope 1.0.4__tar.gz → 1.0.6__tar.gz
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.
- {sqlscope-1.0.4 → sqlscope-1.0.6}/PKG-INFO +1 -1
- {sqlscope-1.0.4 → sqlscope-1.0.6}/pyproject.toml +1 -1
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/select.py +4 -3
- {sqlscope-1.0.4 → sqlscope-1.0.6}/.gitignore +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/.readthedocs.yaml +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/LICENSE +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/Makefile +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/README.md +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/catalogs/constraints.json +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/catalogs/miedema.json +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/sql/constraints.sql +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/sql/miedema.sql +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/Makefile +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/conf.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/index.rst +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/make.bat +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/requirements.txt +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/requirements.txt +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/builder/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/builder/postgres.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/builder/sql.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/catalog.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/column.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/constraint.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/schema.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/table.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/extractors.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/query.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/binary_set_operation.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/set_operation.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/smt.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/tokenized_sql.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/base.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/binary_ops.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/functions.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/predicates.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/primitives.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/queries.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/types.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/unary_ops.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/util.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/__init__.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/column.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/function.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/subquery.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/table.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/sql.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/tokens.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/tests/test_extractors.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/tests/test_query.py +0 -0
- {sqlscope-1.0.4 → sqlscope-1.0.6}/tests/test_typechecking.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlscope
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.6
|
|
4
4
|
Summary: This project extracts catalog and query metadata from a SQL query.
|
|
5
5
|
Project-URL: Repository, https://github.com/DavidePonzini/sqlscope
|
|
6
6
|
Project-URL: Documentation, https://sqlscope.readthedocs.io/en/latest/index.html
|
|
@@ -78,8 +78,10 @@ class Select(SetOperation, TokenizedSQL):
|
|
|
78
78
|
|
|
79
79
|
subquery_sql = expr.this.sql()
|
|
80
80
|
subquery = Select(subquery_sql, catalog=self.catalog, search_path=self.search_path)
|
|
81
|
+
output = subquery.output
|
|
82
|
+
output.name = table_name_out
|
|
81
83
|
|
|
82
|
-
result.append(
|
|
84
|
+
result.append(output)
|
|
83
85
|
|
|
84
86
|
# Table: look it up in the IN catalog
|
|
85
87
|
elif isinstance(expr, exp.Table):
|
|
@@ -104,7 +106,6 @@ class Select(SetOperation, TokenizedSQL):
|
|
|
104
106
|
result.append(table)
|
|
105
107
|
|
|
106
108
|
from_expr = self.ast.args.get('from_')
|
|
107
|
-
|
|
108
109
|
|
|
109
110
|
if from_expr:
|
|
110
111
|
add_tables_from_expression(from_expr.this)
|
|
@@ -480,7 +481,7 @@ class Select(SetOperation, TokenizedSQL):
|
|
|
480
481
|
col_name = util.ast.column.get_real_name(col)
|
|
481
482
|
|
|
482
483
|
# Resolve which table this column belongs to
|
|
483
|
-
table_idx = self._get_table_idx_for_column(col)
|
|
484
|
+
table_idx = self._get_table_idx_for_column(col) or 0 # default to first table if not found, for incorrect queries that group by a column not in any table
|
|
484
485
|
|
|
485
486
|
group_by_cols.add(ConstraintColumn(col_name, table_idx))
|
|
486
487
|
# Add GROUP BY constraint
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|