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.1b5.tar.gz (25.3 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.1b5-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_ydb_backend-0.0.1b5.tar.gz
  • Upload date:
  • Size: 25.3 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.1b5.tar.gz
Algorithm Hash digest
SHA256 0e78daa386d89c5f2f6731dec5e5e3842f6331887b1bcd8cab501e383903de24
MD5 5332862bc4e4598c8726e0c5872aa5e6
BLAKE2b-256 d45ae32593780a383c07e92b7698f758dbe52d6ac794734049bbfe793ec073e8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_ydb_backend-0.0.1b5-py3-none-any.whl
Algorithm Hash digest
SHA256 7ffbd8766f9e2dfd00408f5f0a9878ec0ad786c89ffbefd762c29e4cd428b4d0
MD5 bfac2a86054101a3793465610417f4f2
BLAKE2b-256 e3cf6c3e4af1de39f55cff3f11a4625906a176eb1d64e19bd3e41661a5f2a8fd

See more details on using hashes here.

Provenance

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