Metadata-Version: 2.4
Name: git-sqlite-filter
Version: 0.1.1
Summary: A clean/smudge git filter for SQLite databases with noise reduction
Author-email: Shane <shane@example.com>
Project-URL: Homepage, https://github.com/shane/git-sqlite-filter
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Database
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Dynamic: license-file

git-sqlite-filter
=================

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:

.. code-block:: bash

    pip install git-sqlite-filter

Usage
-----
Configure the filter in your ``.gitattributes``:

.. code-block:: text

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

And in your ``.gitconfig`` (global or local):

.. code-block:: ini

    [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``:

.. code-block:: bash

    GIT_TRACE=1 git diff mydb.sqlite

Development
-----------
Run the test suite with coverage:

.. code-block:: bash

    make dev-deps
    make test

Run linting:

.. code-block:: bash

    make lint
