Skip to main content

SQLite database engine for Django that makes every table a STRICT table.

Project description

django-sqlite-strict

python >= 3.10 Django SQLite prek pytest nox coverage GitHub Actions Workflow Status PyPI Version

django-sqlite-strict is a drop-in replacement for Django's stock SQLite engine that enforces STRICT tables.

Prerequisites

django-sqlite-strict works on Django webapps that use:

  • Django >= 4.2
  • SQLite >= 3.37.0

Install

  1. Add as a dependency:

    uv add django-sqlite-strict
    
  2. In settings.py, add to INSTALLED_APPS after any first-party apps and before django.contrib packages.

    INSTALLED_APPS = [
        ...,
        'django_sqlite_strict',
        ...,
    ]
    
  3. In settings.py, configure DATABASES to use it as the engine:

    DATABASES = {
        "default": {
            "ENGINE": "django_sqlite_strict",
            "NAME": BASE_DIR / "db.sqlite3",
        }
    }
    

Features

System checks

django-sqlite-strict will register the following Django system checks:

  • check_column_types
    Raises an error if any entry in the DATABASES setting has a column of a type that is not accepted by STRICT tables.

Develop

Development prerequisites

The following tools must be available locally to develop django-sqlite-strict:

Run tests

The project aims for 100% test coverage. nox is used to run the test suite against all supported Python/Django pairings (see noxfile.py).

# run latest supported Python/Django pairing only
# (eg. Python 3.14 / Django 6.0)
uvx nox

# run all test sessions
# (ie. all supported Python/Django pairings)
uvx nox -s test

Use the development version in projects

Build the package as a binary distribution (wheel) and install it in a Django project:

# from django-sqlite-strict's root directory
uv build

# in the target Django webapp project
uv add ~/Projects/django-sqlite-strict/dist/django_sqlite_strict-M.m.p-py3-none-any.whl

Acknowledgements

This package was inspired by Martin Dørum's advocacy for STRICT tables in the article SQLite should have (Rust-style) editions.


Shameless self-promotion

Starting a new Django project? Try djereo for a Django project template with modern defaults.

Try pycliché for a no-nonsense Python project template with opinionated tooling.


19th century apparatus to enforce STRICT columns (source, Eton College)

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

django_sqlite_strict-0.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

django_sqlite_strict-0.2.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file django_sqlite_strict-0.2.0.tar.gz.

File metadata

  • Download URL: django_sqlite_strict-0.2.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_sqlite_strict-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2cc1186ca448fb25dc04d79d15b71845eaf10e1013963032b5a7098236d7bc4e
MD5 8d56345fb7f37488f6c59021c89d9825
BLAKE2b-256 fe5e9ccee8169bb5379e14750da1ea463a62811e9718d032cf7d2c13ad20492b

See more details on using hashes here.

File details

Details for the file django_sqlite_strict-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: django_sqlite_strict-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_sqlite_strict-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 644ebf47692ddaffe8e0cecb66fe94c8d1a5b8ec9b85f16291d3647907a007cc
MD5 035815fcd9ecb4fd51edde49fabee876
BLAKE2b-256 dd204263ab10724ed546663ade3866ffd94fdefcb57bb4efc6311c237663f90a

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