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 test 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
$ 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.1b3.tar.gz (25.1 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.1b3-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_ydb_backend-0.0.1b3.tar.gz
  • Upload date:
  • Size: 25.1 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.1b3.tar.gz
Algorithm Hash digest
SHA256 cf774e0c76ccc079c819f5ecdc1ac7fae6e9585d14a030d9cc7b940a369704aa
MD5 458d637f97285c1dee9d675c74966686
BLAKE2b-256 4bd67a2eb6bf10c612856085df50a62ff522a53b39e95c837639fbb256d6ad3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_ydb_backend-0.0.1b3.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.1b3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_ydb_backend-0.0.1b3-py3-none-any.whl
Algorithm Hash digest
SHA256 20d1f0546c6ad868c641ff87d3087ac2c1acd617d933cd3475e2c9b2292f1d0a
MD5 efa6ca0a763dc5f110676aba420083ed
BLAKE2b-256 f43d5295e991b911554c1cd966d8087270d7d8c169cb881250bac994cb6a9499

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_ydb_backend-0.0.1b3-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