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.1b4.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.1b4-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_ydb_backend-0.0.1b4.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.1b4.tar.gz
Algorithm Hash digest
SHA256 577b56448aa87204cfdd771dbdcc2120b51bc3dfbfa1abc1fbc43385913a213e
MD5 b4ad5543c441cd1dfb82c74fae352ce5
BLAKE2b-256 50356b533434dffa67b2f624fca85254a2fa4f8018f4cec5781898e47ebe4f36

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_ydb_backend-0.0.1b4-py3-none-any.whl
Algorithm Hash digest
SHA256 095cd81cf644f3f72cac6a19db566b9de5ca01d0e289147a17d52dd0a3e0fa6e
MD5 f4b3aaee5867108161eccc2c23f3cb18
BLAKE2b-256 8ac3aa365a81fcb75bcc1240f14dc524d2dd71a5571f6627f65b9d8e58e60926

See more details on using hashes here.

Provenance

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