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.1b1.tar.gz (24.4 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.1b1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_ydb_backend-0.0.1b1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.11

File hashes

Hashes for django_ydb_backend-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 8537213a3e7f5329e910b886604f978c155d66430baa416209a5efa0406e2dab
MD5 ed07e88269e52e764e2ba07ee4de6f5c
BLAKE2b-256 b52cfcc3837ba8058f1abc879941235fb3d56d90aad0387c5cd1e7067f0ac0ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_ydb_backend-0.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 58b4de7837056717e8e36ae5c80e4554a9f4b0a3d845fbce886409ac85c3746a
MD5 c150b613cc7270dff858f1566b671657
BLAKE2b-256 f6cb0d792170828ea8459c7e0dbe73f95280266a4e9e72266e98da532d2b69fa

See more details on using hashes here.

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