Connector to use CrateDB as a database in Django ORM.
https://cratedb.com/docs/guide/integrate/django/
uv
uv add cratedb-djangopipx
pipx install cratedb-djangoOnce 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 CrateDBModel as a
base class.
from django.db import models
from cratedb_django.models import CrateDBModel
from cratedb_django.models import functions
class Metrics(CrateDBModel):
id = models.TextField(primary_key=True, db_default=functions.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.
This project is open-source under a MIT license.