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.0.tar.gz (10.0 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.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: git_sqlite_filter-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 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.0.tar.gz
Algorithm Hash digest
SHA256 55b2886919706c7709abc63e62125b3f4d833b662106daa052abea015f84e3ed
MD5 c8474348d00d4a6dc72fa4369dcc87b2
BLAKE2b-256 16611dc0045742091b4dbb53ca2b561fce6d46b64cdc5bfbcf6f8e8815697ec0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for git_sqlite_filter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24fe2d1ef2a6ec158b0bddb8d5005df8a9b6e2e9e442276d00e47aad201f6f73
MD5 d37dbe9c7f3dd43e9db907f60ecc3739
BLAKE2b-256 2d5f3c29d1f5177f37316c2c3a5c94cf741c2b300fbb8d5417497716ee60c21d

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