Skip to main content

A clean/smudge git filter for SQLite databases with noise reduction

Project description

A Git clean/smudge filter for SQLite databases that ensures logical, deterministic SQL dumps.

Features

  • Noise Reduction: Stable row sorting by Primary Key prevents “phantom diffs”.

  • FTS5 Support: Correctly filters virtual table shadow tables for transparent restoration.

  • Generated Columns: Excludes virtual/stored columns from INSERT statements.

  • Lock Resilience: Uses atomic backups to handle busy databases during commits.

Installation

Install directly via pip:

pip install git-sqlite-filter

Usage

Configure the filter in your .gitattributes:

*.sqlite filter=sqlite diff=sqlite
*.db filter=sqlite diff=sqlite

And in your .gitconfig (global or local):

[filter "sqlite"]
    clean = git-sqlite-clean %f
    smudge = git-sqlite-smudge %f
    required = true
[diff "sqlite"]
    # Allows 'git diff' to show readable SQL changes
    textconv = git-sqlite-clean

Debugging

Enable debug logging with the --debug flag or by setting GIT_TRACE=1:

GIT_TRACE=1 git diff mydb.sqlite

Development

Run the test suite with coverage:

make dev-deps
make test

Run linting:

make lint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_sqlite_filter-0.1.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_sqlite_filter-0.1.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file git_sqlite_filter-0.1.1.tar.gz.

File metadata

  • Download URL: git_sqlite_filter-0.1.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for git_sqlite_filter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 881e7a30078ee3466cb2098561626ef9929dcc6a5d6b1b9a922f9fcaab9310a9
MD5 6c4f30edc560944d12411f43de7aae60
BLAKE2b-256 2c9f0c56485691c410157e56caccb503023b57548b9d2a5c142dc2c2bb2d368f

See more details on using hashes here.

File details

Details for the file git_sqlite_filter-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for git_sqlite_filter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cad6cf3f2b7b2a198bb51c0ea1b15438efa45ca04921be5b5f2cb4d7bf9ef5dc
MD5 efa78914ad22b9ac12a4a40fa8f2bf4d
BLAKE2b-256 a2cc69a9e2b798aac24ea3958d9ca5c7e8a6b99d3de72eb446422d2f953a1a05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page