comdab 0.2.0__tar.gz → 0.2.1__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 (56) hide show
  1. {comdab-0.2.0 → comdab-0.2.1}/CHANGELOG.md +6 -0
  2. {comdab-0.2.0 → comdab-0.2.1}/PKG-INFO +1 -1
  3. {comdab-0.2.0 → comdab-0.2.1}/pyproject.toml +1 -1
  4. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/build.py +3 -0
  5. {comdab-0.2.0 → comdab-0.2.1}/tests/test_specific/test_postgresql.py +31 -0
  6. {comdab-0.2.0 → comdab-0.2.1}/uv.lock +1 -1
  7. {comdab-0.2.0 → comdab-0.2.1}/.github/workflows/release.yml +0 -0
  8. {comdab-0.2.0 → comdab-0.2.1}/.github/workflows/test.yml +0 -0
  9. {comdab-0.2.0 → comdab-0.2.1}/.gitignore +0 -0
  10. {comdab-0.2.0 → comdab-0.2.1}/.pre-commit-config.yaml +0 -0
  11. {comdab-0.2.0 → comdab-0.2.1}/.python-version +0 -0
  12. {comdab-0.2.0 → comdab-0.2.1}/.readthedocs.yaml +0 -0
  13. {comdab-0.2.0 → comdab-0.2.1}/LICENSE +0 -0
  14. {comdab-0.2.0 → comdab-0.2.1}/README.md +0 -0
  15. {comdab-0.2.0 → comdab-0.2.1}/docs/Makefile +0 -0
  16. {comdab-0.2.0 → comdab-0.2.1}/docs/conf.py +0 -0
  17. {comdab-0.2.0 → comdab-0.2.1}/docs/index.rst +0 -0
  18. {comdab-0.2.0 → comdab-0.2.1}/docs/reference.rst +0 -0
  19. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/__init__.py +0 -0
  20. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/compare.py +0 -0
  21. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/exceptions.py +0 -0
  22. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/main.py +0 -0
  23. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/__init__.py +0 -0
  24. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/base.py +0 -0
  25. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/column.py +0 -0
  26. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/constraint.py +0 -0
  27. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/function.py +0 -0
  28. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/index.py +0 -0
  29. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/schema.py +0 -0
  30. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/sequence.py +0 -0
  31. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/table.py +0 -0
  32. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/trigger.py +0 -0
  33. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/type.py +0 -0
  34. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/view.py +0 -0
  35. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/path.py +0 -0
  36. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/py.typed +0 -0
  37. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/report.py +0 -0
  38. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/source.py +0 -0
  39. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/__init__.py +0 -0
  40. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/__init__.py +0 -0
  41. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/build.py +0 -0
  42. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/exclude_constraints.py +0 -0
  43. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/functions.py +0 -0
  44. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/sequences.py +0 -0
  45. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/triggers.py +0 -0
  46. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/views.py +0 -0
  47. {comdab-0.2.0 → comdab-0.2.1}/src/comdab/utils.py +0 -0
  48. {comdab-0.2.0 → comdab-0.2.1}/tests/__init__.py +0 -0
  49. {comdab-0.2.0 → comdab-0.2.1}/tests/_mock_module.py +0 -0
  50. {comdab-0.2.0 → comdab-0.2.1}/tests/conftest.py +0 -0
  51. {comdab-0.2.0 → comdab-0.2.1}/tests/test_build.py +0 -0
  52. {comdab-0.2.0 → comdab-0.2.1}/tests/test_compare.py +0 -0
  53. {comdab-0.2.0 → comdab-0.2.1}/tests/test_main.py +0 -0
  54. {comdab-0.2.0 → comdab-0.2.1}/tests/test_models.py +0 -0
  55. {comdab-0.2.0 → comdab-0.2.1}/tests/test_specific/__init__.py +0 -0
  56. {comdab-0.2.0 → comdab-0.2.1}/tests/test_utils.py +0 -0
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.1] - 2025-08-06
9
+
10
+ ### Fixed
11
+
12
+ - Fix crash when reflecting tables without a primary key
13
+
8
14
  ## [0.2.0] - 2025-07-23
9
15
 
10
16
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comdab
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Compare Database Schemas
5
5
  Project-URL: Homepage, https://github.com/loic-simon/comdab
6
6
  Project-URL: Documentation, https://comdab.readthedocs.io/en/latest
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "comdab"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Compare Database Schemas"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -93,6 +93,9 @@ class ComdabBuilder:
93
93
 
94
94
  def generate_constraints(self, sa_table: schema.Table) -> Iterator[ComdabConstraint]:
95
95
  for sa_constraint in sa_table.constraints:
96
+ if isinstance(sa_constraint, schema.PrimaryKeyConstraint) and not sa_constraint.columns:
97
+ # Non-existing constraint created because SQLAlchemy needs a primary key per table: ignore
98
+ continue
96
99
  yield self.build_constraint(sa_constraint)
97
100
 
98
101
  def generate_indexes(self, sa_table: schema.Table) -> Iterator[ComdabIndex]:
@@ -844,3 +844,34 @@ def test_psql_types(connection: Connection, meta: MetaData) -> None:
844
844
  },
845
845
  functions={},
846
846
  )
847
+
848
+
849
+ def test_no_primary_key_ignore_fake_constraint(connection: Connection) -> None:
850
+ # Not really psql-specific, but needs a DB
851
+
852
+ connection.exec_driver_sql("CREATE TABLE table_1 (id INTEGER);") # no primary key
853
+
854
+ builder = ComdabPostgreSQLBuilder(ComdabSource(connection=connection, schema_name="public"))
855
+ assert builder.build_schema() == ComdabSchema(
856
+ tables={
857
+ "table_1": ComdabTable(
858
+ name="table_1",
859
+ columns={
860
+ "id": ComdabColumn(
861
+ name="id",
862
+ type=ComdabTypes.Integer(implem_name="INTEGER"),
863
+ nullable=True,
864
+ default=None,
865
+ generation_expression=None,
866
+ ),
867
+ },
868
+ constraints={},
869
+ indexes={},
870
+ triggers={},
871
+ extra={},
872
+ ),
873
+ },
874
+ views={},
875
+ sequences={},
876
+ functions={},
877
+ )
@@ -84,7 +84,7 @@ wheels = [
84
84
 
85
85
  [[package]]
86
86
  name = "comdab"
87
- version = "0.2.0"
87
+ version = "0.2.1"
88
88
  source = { editable = "." }
89
89
  dependencies = [
90
90
  { name = "pydantic" },
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