Skip to main content

Django backend for YDB

Project description

django-ydb-backend

Django YDB Backend Overview This is a Django database backend for YDB, a distributed SQL database system. The backend allows Django applications to use YDB as their primary database while maintaining compatibility with Django's ORM layer.

Key Features

  • Full Django ORM support for basic CRUD operations
  • Compatible with Django migrations system (with YDB-specific adaptations)
  • Supports most common field types and query operations
  • Implements necessary Django database backend interfaces

Underlying Technology

DBAPI Layer.

This backend uses the official YDB-DBAPI interface. The SDK provides:

  • Connection pooling
  • Session management
  • Native support for YDB's distributed transactions
  • Efficient data type handling

Supported YDB Features

Table Operations:

  • CREATE/DROP/ALTER TABLE
  • Secondary indexes (with some limitations)

Data Types:

  • All primitive YDB types (Int32, Utf8, Bool, etc.)
  • Optional types (NULL support)
  • JSON support via JSONField

Query Capabilities:

  • SELECT with WHERE, ORDER BY, LIMIT
  • Basic aggregations (COUNT, SUM, etc.)
  • INSERT/UPDATE/DELETE/UPSERT operations

Requirements:

Get started

$ pip install django-ydb-backend

Configurations

To set up your Django project to use a YDB backend, you only need to modify a few of Django's built-in configuration settings. This project does not require any additional custom configuration options. (Summary: Just adjust standard Django settings for YDB—no extra YDB-specific configurations are needed.)

DATABASES

  • NAME (required): traditional Django databases use this as the database name.
  • ENGINE (required): required, set to ydb_backend.backend.
  • HOST (required): the hostname or IP address of the YDB server (e.g., "localhost").
  • PORT (required): The gRPC port YDB is running on (default is 2136).
  • DATABASE (required): The full path to your YDB database (e.g., "/local" for local testing or "/my_production_db").
DATABASES = {
   "default": {
       "NAME": "ydb_db",
       "ENGINE": "ydb_backend.backend",
       "HOST": "localhost",
       "PORT": "2136",
       "DATABASE": "/local",
   }
}

Test

To run tests for this project:

$ git clone https://github.com/ydb-platform/django-ydb-backend.git
$ cd django-ydb-backend
# docker and docker compose are required.
$ docker compose up -d --wait
$ pip install poetry && poetry install
$ poetry run python tests/runtests.py

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

django_ydb_backend-0.0.1b6.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

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

django_ydb_backend-0.0.1b6-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file django_ydb_backend-0.0.1b6.tar.gz.

File metadata

  • Download URL: django_ydb_backend-0.0.1b6.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_ydb_backend-0.0.1b6.tar.gz
Algorithm Hash digest
SHA256 c8069b5ae34e240c7cdb5cf1f3ebaa8c39bbb7ab3dc3ea4ff1e2644ad218e889
MD5 9fe71097b7bc7d56346d9a333b0cfedf
BLAKE2b-256 59a05841924a310bb67717c9edb01e0829a219c7453dac963f2e04bbca18cd21

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_ydb_backend-0.0.1b6.tar.gz:

Publisher: python-publish.yml on ydb-platform/django-ydb-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_ydb_backend-0.0.1b6-py3-none-any.whl.

File metadata

File hashes

Hashes for django_ydb_backend-0.0.1b6-py3-none-any.whl
Algorithm Hash digest
SHA256 d1ecf8f8af6116ff0703bf6c612933dfc868be769bd6b7e927523f89bc63d8d5
MD5 a046cc81707d6fa865afae169b61eae3
BLAKE2b-256 ffb48b44fe5f704ee37c7853b6f434a9dafc26fce5b8b9f9cf92f0baa35f2085

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_ydb_backend-0.0.1b6-py3-none-any.whl:

Publisher: python-publish.yml on ydb-platform/django-ydb-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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