Skip to main content

CrateDB connector for Django

Project description

CrateDB django connector.

PyPI - Version PyPI - Python Version PyPI - License PyPI - Status 🛠🐍 Unit tests

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cratedb_django-0.0.8.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

cratedb_django-0.0.8-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file cratedb_django-0.0.8.tar.gz.

File metadata

  • Download URL: cratedb_django-0.0.8.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","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 cratedb_django-0.0.8.tar.gz
Algorithm Hash digest
SHA256 ddc5941598b357cb71c28d2d03e1bc53352105b793a9fd53d86e588c7136ea21
MD5 397d1c3d10d328df1b1e77ff8a2894cf
BLAKE2b-256 a90c4f1d76df3d5bc86a5ba1d0b53a0050a3d7827a65945c0d64c5255bc9994e

See more details on using hashes here.

File details

Details for the file cratedb_django-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: cratedb_django-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","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 cratedb_django-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2421517e277a60d9c913370e9139d5b5fbf52cfe5cae1e49bbe2e52a92be3f66
MD5 91769a91ef261e84626a81cdcd880ac8
BLAKE2b-256 e4123ab6011ee8f8fdeec79d15b6eb9f4f60b633f955f55df0a3e25ce8b10853

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