DatabaseDiff¶
- class felis.diff.DatabaseDiff(schema, engine)¶
Bases:
SchemaDiffCompare a schema with a database and emit structured differences.
- Parameters:
Notes
The
DatabaseDiffclass uses SQLAlchemy to reflect the database schema and compare it with the providedSchemaobject. It generates a list of differences between the two schemas, which can be printed or converted to a structured format.The error-handling during the reflection and comparison process is robust, catching various exceptions that may arise from database connectivity issues, invalid configurations, or unexpected errors. This is done because otherwise some obscure errors may be raised during the reflection process and configuration of alembic, which are not very informative to the user.
Methods Summary
print([output_stream])Print the differences between the schema and the database as JSON.
Convert database differences to structured format.
Methods Documentation
- print(output_stream=None)¶
Print the differences between the schema and the database as JSON.