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.
Files changed (57) hide show
  1. {sqlscope-1.0.4 → sqlscope-1.0.6}/PKG-INFO +1 -1
  2. {sqlscope-1.0.4 → sqlscope-1.0.6}/pyproject.toml +1 -1
  3. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/select.py +4 -3
  4. {sqlscope-1.0.4 → sqlscope-1.0.6}/.gitignore +0 -0
  5. {sqlscope-1.0.4 → sqlscope-1.0.6}/.readthedocs.yaml +0 -0
  6. {sqlscope-1.0.4 → sqlscope-1.0.6}/LICENSE +0 -0
  7. {sqlscope-1.0.4 → sqlscope-1.0.6}/Makefile +0 -0
  8. {sqlscope-1.0.4 → sqlscope-1.0.6}/README.md +0 -0
  9. {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/catalogs/constraints.json +0 -0
  10. {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/catalogs/miedema.json +0 -0
  11. {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/sql/constraints.sql +0 -0
  12. {sqlscope-1.0.4 → sqlscope-1.0.6}/datasets/sql/miedema.sql +0 -0
  13. {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/Makefile +0 -0
  14. {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/conf.py +0 -0
  15. {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/index.rst +0 -0
  16. {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/make.bat +0 -0
  17. {sqlscope-1.0.4 → sqlscope-1.0.6}/docs/requirements.txt +0 -0
  18. {sqlscope-1.0.4 → sqlscope-1.0.6}/requirements.txt +0 -0
  19. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/__init__.py +0 -0
  20. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/__init__.py +0 -0
  21. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/builder/__init__.py +0 -0
  22. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/builder/postgres.py +0 -0
  23. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/builder/sql.py +0 -0
  24. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/catalog.py +0 -0
  25. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/column.py +0 -0
  26. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/constraint.py +0 -0
  27. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/schema.py +0 -0
  28. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/catalog/table.py +0 -0
  29. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/__init__.py +0 -0
  30. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/extractors.py +0 -0
  31. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/query.py +0 -0
  32. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/__init__.py +0 -0
  33. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/binary_set_operation.py +0 -0
  34. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/set_operations/set_operation.py +0 -0
  35. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/smt.py +0 -0
  36. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/tokenized_sql.py +0 -0
  37. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/__init__.py +0 -0
  38. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/base.py +0 -0
  39. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/binary_ops.py +0 -0
  40. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/functions.py +0 -0
  41. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/predicates.py +0 -0
  42. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/primitives.py +0 -0
  43. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/queries.py +0 -0
  44. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/types.py +0 -0
  45. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/unary_ops.py +0 -0
  46. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/query/typechecking/util.py +0 -0
  47. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/__init__.py +0 -0
  48. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/__init__.py +0 -0
  49. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/column.py +0 -0
  50. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/function.py +0 -0
  51. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/subquery.py +0 -0
  52. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/ast/table.py +0 -0
  53. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/sql.py +0 -0
  54. {sqlscope-1.0.4 → sqlscope-1.0.6}/src/sqlscope/util/tokens.py +0 -0
  55. {sqlscope-1.0.4 → sqlscope-1.0.6}/tests/test_extractors.py +0 -0
  56. {sqlscope-1.0.4 → sqlscope-1.0.6}/tests/test_query.py +0 -0
  57. {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.4
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sqlscope"
7
- version = "1.0.4"
7
+ version = "1.0.6"
8
8
  authors = [
9
9
  { name="Davide Ponzini", email="davide.ponzini95@gmail.com" },
10
10
  ]
@@ -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(subquery.output)
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