Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CrateDB backend for Django

License

NotificationsYou must be signed in to change notification settings

crate/cratedb-django

PyPI - VersionPyPI - Python VersionPyPI - LicensePyPI - 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 yoursettings.py, e.g.

DATABASES= {"default": {"ENGINE":"cratedb_django","SERVERS": ["localhost:4200"],    }}

After that, for a model to be used in CrateDB, you need to useCrateModel as a base class.

fromdjango.dbimportmodelsfromcratedb_django.modelsimportCrateModelclassMetrics(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=truewill emit a warning to stdout.

Environment variables

namevaluedescription
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.

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp