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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b2886919706c7709abc63e62125b3f4d833b662106daa052abea015f84e3ed
|
|
| MD5 |
c8474348d00d4a6dc72fa4369dcc87b2
|
|
| BLAKE2b-256 |
16611dc0045742091b4dbb53ca2b561fce6d46b64cdc5bfbcf6f8e8815697ec0
|
File details
Details for the file git_sqlite_filter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_sqlite_filter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24fe2d1ef2a6ec158b0bddb8d5005df8a9b6e2e9e442276d00e47aad201f6f73
|
|
| MD5 |
d37dbe9c7f3dd43e9db907f60ecc3739
|
|
| BLAKE2b-256 |
2d5f3c29d1f5177f37316c2c3a5c94cf741c2b300fbb8d5417497716ee60c21d
|