SQLite database engine for Django that makes every table a STRICT table.
Project description
django-sqlite-strict
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
-
Add as a dependency:
uv add django-sqlite-strict
-
In
settings.py, add toINSTALLED_APPSafter any first-party apps and beforedjango.contribpackages.INSTALLED_APPS = [ ..., 'django_sqlite_strict', ..., ]
-
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 theDATABASESsetting 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.
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cc1186ca448fb25dc04d79d15b71845eaf10e1013963032b5a7098236d7bc4e
|
|
| MD5 |
8d56345fb7f37488f6c59021c89d9825
|
|
| BLAKE2b-256 |
fe5e9ccee8169bb5379e14750da1ea463a62811e9718d032cf7d2c13ad20492b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644ebf47692ddaffe8e0cecb66fe94c8d1a5b8ec9b85f16291d3647907a007cc
|
|
| MD5 |
035815fcd9ecb4fd51edde49fabee876
|
|
| BLAKE2b-256 |
dd204263ab10724ed546663ade3866ffd94fdefcb57bb4efc6311c237663f90a
|