pgdevkit 0.2.2__py3-none-any.whl → 0.2.3__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.
pgdevkit/testdb/schema.py CHANGED
@@ -94,7 +94,11 @@ def _get_sql_deps(sql: str) -> set[str]:
94
94
  continue
95
95
  for t in e.find_all(exp.Table):
96
96
  if t.args.get("this") is not None and t.args.get("db") is not None:
97
- deps.add(str(t))
97
+ # exp.table_name(), not str(t): str() includes " AS alias" for
98
+ # an aliased reference (e.g. "FROM editing.visit v"), which
99
+ # would never match the plain declared name any dependent
100
+ # file's own CREATE target is recorded under.
101
+ deps.add(exp.table_name(t))
98
102
  return deps
99
103
 
100
104
 
@@ -119,7 +123,7 @@ def _iter_sql_files(database_dir: Path):
119
123
  deps = _get_sql_deps(content)
120
124
  if file.parent.name in _SCHEMA_QUALIFIED_TYPES:
121
125
  schema = _strip_layer_prefix(file.parent.parent.name)
122
- full_name = f"{schema}.{file.stem}"
126
+ full_name = f"{schema}.{_strip_layer_prefix(file.stem)}"
123
127
  deps.discard(full_name) # the file's own CREATE target is not a real dependency
124
128
  all_declared.add(full_name)
125
129
  if not deps or all(d in delivered for d in deps):
@@ -219,7 +223,8 @@ async def apply_schema(
219
223
  json_file = file.with_suffix(".test_data.json")
220
224
  if json_file.exists():
221
225
  schema_name = _strip_layer_prefix(file.parent.parent.name)
222
- await _insert_test_data(json_file, f"{schema_name}.{file.stem}", force_reset, con, complex_helper)
226
+ table_stem = _strip_layer_prefix(file.stem)
227
+ await _insert_test_data(json_file, f"{schema_name}.{table_stem}", force_reset, con, complex_helper)
223
228
 
224
229
  failures: list[tuple[Path, str]] = []
225
230
  for file, sql in _iter_sql_files(database_dir):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pgdevkit
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A helper for developing with Postgres
5
5
  Requires-Python: >=3.14
6
6
  Requires-Dist: docker>=7.1.0
@@ -20,12 +20,12 @@ pgdevkit/testdb/constants.py,sha256=xi8uIoEgN9LrRkr41j3mmWB9PqqU0r8aCUb2JJXBAs0,
20
20
  pgdevkit/testdb/container.py,sha256=R_IhazRw_c0HteDtESO6RY6XWHp995FP5RRA4LK7Fh0,4068
21
21
  pgdevkit/testdb/naming.py,sha256=Kyk5qEfxUkbggUG5bD7U7CJ_kAET332VPQNB-O5kvTY,1318
22
22
  pgdevkit/testdb/query.py,sha256=e4UbgdCKKIot3a8Qixg-OX-Af0rlQ4a8ODhJBD8mtVM,2318
23
- pgdevkit/testdb/schema.py,sha256=-whDO8JTggFPNZtymzQ7dpsqMdQ-wUYAlRdWuyT4CAQ,9590
23
+ pgdevkit/testdb/schema.py,sha256=CpKee72evg9dngo744VXcbn8YHTq5AQIY0xgF-6eMkU,9970
24
24
  pgdevkit/docs/database-layout.md,sha256=dNvDH956xSXuAnLqkOopyOfaIm_A-RtUd57VTaZ1GQU,6035
25
25
  pgdevkit/skills/pgdevkit/SKILL.md,sha256=6uxe6BQwOLexGiBpf00VTFTHOiWJo5k2Qqzu172rb4I,12156
26
26
  pgdevkit/skills/pgdevkit/references/dynamic-sql.md,sha256=aTR1sx81moiTwaMaiOecaqk-9rT8y5Zxz7W1BoC3vK0,2774
27
27
  pgdevkit/skills/pgdevkit/references/temporal-tables.md,sha256=LwZnItvQWI7bB0oRHxIfUc0ynnq7N0V5Mnv-QHvFN3Q,1364
28
- pgdevkit-0.2.2.dist-info/METADATA,sha256=56tCcCKLAnudYqguZtBn60RMnmGmKt-sk0yeFEG-y8c,5915
29
- pgdevkit-0.2.2.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
30
- pgdevkit-0.2.2.dist-info/entry_points.txt,sha256=FK2P55lf0WaGlOZJIINOGgCt8WB7ep0OnPsgnrp80bg,42
31
- pgdevkit-0.2.2.dist-info/RECORD,,
28
+ pgdevkit-0.2.3.dist-info/METADATA,sha256=TLAMgx_QXdQmoqQyalKNEQcwd9VupvVH3ZPn4e3BZQk,5915
29
+ pgdevkit-0.2.3.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
30
+ pgdevkit-0.2.3.dist-info/entry_points.txt,sha256=FK2P55lf0WaGlOZJIINOGgCt8WB7ep0OnPsgnrp80bg,42
31
+ pgdevkit-0.2.3.dist-info/RECORD,,