Skip to main content

A database migration tool for Qdrant Vector DB.

Project description

Orthant

PyPI version

Orthant is a migration tool for Qdrant Vector Database, inspired by the Alembic. It aims to bring deterministic, version-controlled schema management for your vector DB.

Motivation

Migration management guarantees that the database state is a deterministic function of the codebase, eliminating environment drift and deployment headaches.

I have been using Alembic for as long as I can remember for my relational DB needs. However, recently I have been working increasingly around vector databases like Qdrant. While Qdrant is incredibly powerful, I found myself missing the rigorous, version-controlled workflow for managing collections, indexes, and payload schemas that I am used to. Manually applying changes across development, staging, and production environments made my life full of headaches.

That's why I built Orthant, a dedicated migration tool that provides the same robust, dependency-aware workflow for your Qdrant vector database.

Installation

Orthant is available on PyPI.

  • Via uv

    uv add orthant
    
  • Via pip

    pip install orthant
    

Usage

The CLI is designed to be simple and intuitive.

1. Configuration (pyproject.toml)

First, configure the path to your migrations directory in your pyproject.toml file. This tells Orthant where to find its files, removing the need for a command-line flag.

# pyproject.toml

[tool.orthant]
# The path where your migration environment will be initialized.
base_dir = "app/orthant"

2. Initialize the Environment

Run the init command. Orthant will use the path from your pyproject.toml to scaffold the necessary files.

orthant init

This creates the migration environment:

app/orthant/
├── versions/
├── env.py         # <-- IMPORTANT: Configure your DB connection here
├── script.py.mako
└── README.md

3. Create a New Migration

Generate a new migration script using new. Use the -m flag for a short summary, and add more -m flags for a longer description, just like git commit.

orthant new -m "Add New Collection"

4. Edit the Migration Script

Open the new file (e.g., app/orthant/versions/20250922101337...py) and add your logic.

"""Add New Collection

Revision ID: 20250922101337
Revises:
Create Date: 2025-09-22T10:13:37.364635+00:00
"""

from qdrant_client import QdrantClient, models

# revision identifiers, used by the migration tool
revision = "20250922101337"
down_revision = "None"


def upgrade(client: QdrantClient) -> None:
    # ### commands auto-generated by Orthant - please adjust! ###
    pass
    # ### end Orthant commands ###

def downgrade(client: QdrantClient) -> None:
    # ### commands auto-generated by Orthant - please adjust! ###
    pass
    # ### end Orthant commands ###

5. Apply and Manage Migrations

# Apply all new migrations
orthant upgrade head

# Check the current state of the database
orthant current

# Revert the last applied migration
orthant downgrade

# See all commands and options
orthant --help

Contributing

Contributions are welcome! Whether it's a bug report, a feature request, or a pull request, we appreciate your help. Please feel free to open an issue or submit a PR.

Acknowledgements

  • Alembic Team for creating the gold standard of database migration tools, which served as the primary inspiration.
  • Qdrant for building an incredible open-source vector database.

License

This project is licensed under the BSD-2-Clause License.

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

orthant-0.1.2.tar.gz (73.0 kB view details)

Uploaded Source

Built Distribution

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

orthant-0.1.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file orthant-0.1.2.tar.gz.

File metadata

  • Download URL: orthant-0.1.2.tar.gz
  • Upload date:
  • Size: 73.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for orthant-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b52fe54c3e67422d788fb4595b3ef9aa404b089b45573c24ada62a44006f1f95
MD5 8e7664238d7b4676c6d6d1a4ae4e61ba
BLAKE2b-256 3e251ed19422a756140a7228af0a79b968d2894fff234db7d1550d6bb590de46

See more details on using hashes here.

File details

Details for the file orthant-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: orthant-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.7

File hashes

Hashes for orthant-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb053a63d0cb53fee6feaaa12aaa2c1823d0518f840f0b22281f366207a9c3de
MD5 8f81c0d2610cc7c969ab51d56bcdd255
BLAKE2b-256 43ff7a4b089efa52074f9bd40019eb6cfb1a389d7dcc0244383dd985939d5eca

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