What's New
Schema object diffing (issues #99–#102)
DeepDiff DB now detects and migrates views, stored routines, triggers, and sequences alongside table-level changes.
Views
- Added/removed/modified views tracked with full definition comparison
- Materialised view support (PostgreSQL)
- Driver-aware migration:
CREATE OR REPLACE VIEW(PostgreSQL),CREATE VIEWwith drop guard (MySQL/SQLite) ignore.viewsconfig key;allow_drop_viewsafety control
Routines (stored procedures & functions)
- Diffs across definition, kind (FUNCTION/PROCEDURE), return type, language, and parameters
- Driver-aware migration: MySQL
DELIMITER $$blocks; PostgreSQLCREATE OR REPLACE FUNCTION ignore.routinesconfig key;allow_drop_routinesafety control
Triggers
- Per-table tracking with timing (BEFORE/AFTER/INSTEAD OF), event (INSERT/UPDATE/DELETE), and definition comparison
- PostgreSQL
ON tablesyntax; MSSQL/Oracle variants ignore.triggersconfig key;allow_drop_triggersafety control
Sequences (PostgreSQL only)
- Loaded from
pg_sequences(PG 10+) orinformation_schema.sequences(PG <10) - Diffs start value, increment, min/max value, cache size, and cycle flag
ignore.sequencesconfig key;allow_drop_sequencesafety control
HTML report extended
The Schema tab now shows Views, Routines, Triggers, and Sequences sections alongside table changes. The tab badge counts all object types combined.
A live sample report is available at the documentation site.
Bug Fixes
- MySQL views introspected as tables — added
table_type = 'BASE TABLE'filter to column query - MySQL view definition false-positive diff — strip embedded
`dbname`.prefix before comparison - HTML report version showing
v0.5— now injected from ldflagsversionvariable addtemplate function arity mismatch — changed to variadic to support 2+ arguments- PostgreSQL <10 sequence scan panic — scan
character_datacolumns as strings, parse withstrconv.ParseInt loadSequenceserror for MSSQL/Oracle — non-PostgreSQL drivers now returnnil
Test Coverage
| Package | Before | After |
|---|---|---|
internal/schema |
64% | 70% |
internal/report/html |
68% | 90% |
Full Changelog
https://github.com/iamvirul/deepdiff-db/blob/main/CHANGELOG.md#140---2026-05-03