CrateDB connector for Django
Project description
CrateDB django connector.
Connector to use CrateDB as a database in Django ORM.
Documentation
How to install
uv
uv add cratedb-django
pipx
pipx install cratedb-django
Install
Once the library is installed, use it in your settings.py, e.g.
DATABASES = {
"default": {
"ENGINE": "cratedb_django",
"SERVERS": ["localhost:4200"],
}
}
After that, for a model to be used in CrateDB, you need to use CrateModel as a
base class.
from django.db import models
from cratedb_django.models import CrateModel
class Metrics(CrateModel):
id = models.TextField(primary_key=True, db_default=UUID())
value = models.IntegerField()
Django migrations can be run in CrateDB, default django migrations are tested. In spite of that, we recommend that you run anything transactional in a transactional database, like PostgresSQL and use CrateDB as your analytical database.
Details
unique=True. CrateDB only supports unique constraints on primary keys, any model field with unique=true will emit a warning to stdout.
Environment variables
| name | value | description |
|---|---|---|
SUPPRESS_UNIQUE_CONSTRAINT_WARNING |
[true/false] |
Suppresses warning when a model is created with unique=True constraint. |
License
This project is open-source under a MIT license.
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 cratedb_django-0.0.7.tar.gz.
File metadata
- Download URL: cratedb_django-0.0.7.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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 |
ad3e8b05d2df299c6ccedefba4b993b36b5c56420db3e1cf6f462c010a7a13db
|
|
| MD5 |
2bf1a0492eee56df91fa7c88a57c5dda
|
|
| BLAKE2b-256 |
30825d90992ffd717f4dcbc5fe9dd0197d827b8684a934cb18ada85f255e584f
|
File details
Details for the file cratedb_django-0.0.7-py3-none-any.whl.
File metadata
- Download URL: cratedb_django-0.0.7-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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 |
2bd360fc372ae5146427dc58d17276f1260e1765b4a5808a86cf4e35cf22f2de
|
|
| MD5 |
de84086df2e63020bcca027a2f0ac681
|
|
| BLAKE2b-256 |
e776f963fde04d6737080ee6d24fa4fe83c6f030daef6d5a147990fdcd5e8ad3
|