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.
- {comdab-0.2.0 → comdab-0.2.1}/CHANGELOG.md +6 -0
- {comdab-0.2.0 → comdab-0.2.1}/PKG-INFO +1 -1
- {comdab-0.2.0 → comdab-0.2.1}/pyproject.toml +1 -1
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/build.py +3 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/test_specific/test_postgresql.py +31 -0
- {comdab-0.2.0 → comdab-0.2.1}/uv.lock +1 -1
- {comdab-0.2.0 → comdab-0.2.1}/.github/workflows/release.yml +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/.github/workflows/test.yml +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/.gitignore +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/.pre-commit-config.yaml +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/.python-version +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/.readthedocs.yaml +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/LICENSE +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/README.md +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/docs/Makefile +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/docs/conf.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/docs/index.rst +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/docs/reference.rst +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/__init__.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/compare.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/exceptions.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/main.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/__init__.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/base.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/column.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/constraint.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/function.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/index.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/schema.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/sequence.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/table.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/trigger.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/type.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/models/view.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/path.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/py.typed +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/report.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/source.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/__init__.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/__init__.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/build.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/exclude_constraints.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/functions.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/sequences.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/triggers.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/specific/postgresql/views.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/src/comdab/utils.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/__init__.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/_mock_module.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/conftest.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/test_build.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/test_compare.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/test_main.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/test_models.py +0 -0
- {comdab-0.2.0 → comdab-0.2.1}/tests/test_specific/__init__.py +0 -0
- {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
|
|
@@ -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
|
+
)
|
|
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
|