Skip to content

Choose a tag to compare

@iamvirul iamvirul released this 03 May 11:49
· 73 commits to main since this release
40afb1e

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 VIEW with drop guard (MySQL/SQLite)
  • ignore.views config key; allow_drop_view safety control

Routines (stored procedures & functions)

  • Diffs across definition, kind (FUNCTION/PROCEDURE), return type, language, and parameters
  • Driver-aware migration: MySQL DELIMITER $$ blocks; PostgreSQL CREATE OR REPLACE FUNCTION
  • ignore.routines config key; allow_drop_routine safety control

Triggers

  • Per-table tracking with timing (BEFORE/AFTER/INSTEAD OF), event (INSERT/UPDATE/DELETE), and definition comparison
  • PostgreSQL ON table syntax; MSSQL/Oracle variants
  • ignore.triggers config key; allow_drop_trigger safety control

Sequences (PostgreSQL only)

  • Loaded from pg_sequences (PG 10+) or information_schema.sequences (PG <10)
  • Diffs start value, increment, min/max value, cache size, and cycle flag
  • ignore.sequences config key; allow_drop_sequence safety 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 ldflags version variable
  • add template function arity mismatch — changed to variadic to support 2+ arguments
  • PostgreSQL <10 sequence scan panic — scan character_data columns as strings, parse with strconv.ParseInt
  • loadSequences error for MSSQL/Oracle — non-PostgreSQL drivers now return nil

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