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

Uploaded Python 3

File details

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

File metadata

  • Download URL: git_sqlite_filter-0.1.2.tar.gz
  • Upload date:
  • Size: 12.5 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.2.tar.gz
Algorithm Hash digest
SHA256 f0658b765e78babee6c5d0577a9500b5521f281df7fce8b268b1f6a8967988ab
MD5 f269ae94522b16ab2dedda09fab83d93
BLAKE2b-256 879e2f0f0c215cc118e7fa73b955a0e3fd8dac5dca24222d48bc60effc0d4f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for git_sqlite_filter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38a473de056687e64f06bd0556a6e5f532fe87ff05b55dedac9c36ac8046f380
MD5 419c73c89ad862f9f7d635c32295821c
BLAKE2b-256 994f4add09aecdbb691a5bb4958195b41071187a4c9708bb55bd4e86fe9af8ff

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