$npx skillfedfor your agent

clickhouse-migrations

Simple file-based migrations for clickhouse

Worth itPyPI DatabaseReleased Jul 202674.8K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — clickhouse_migrations-0.13.0-py3-none-any.whl
v0.13.0 · released 2026-07-08 · Python <4,>=3.9 · 1 runtime deps: clickhouse-driver

Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real problem for ClickHouse users. It is the most actively maintained migration tool for ClickHouse in Python and supports features (multi-statement files, cluster awareness) that alternatives lack. MIT licensing adds no restrictions.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a running ClickHouse server accessible at the specified host and port (default 9000 for clickhouse-driver, 8123 for clickhouse-connect).
  • Low friction: pure Python wheel with a single runtime dependency (clickhouse-driver).
  • Actively maintained as of 2026-07-08 with recent releases.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal attribution requirements.

last release 2026-07-08 (37 days) · last repo commit 2026-07-08 · 38 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 74,838 downloads/mo, #14,784 on PyPI

Verify before relying

pip install clickhouse-migrations

# Create migrations/001_init.sql with SQL statements
clickhouse-migrations --db-host localhost --db-name mydb --migrations-dir ./migrations

# Or in Python:
from clickhouse_migrations.clickhouse_cluster import ClickhouseCluster
cluster = ClickhouseCluster(db_host="localhost")
cluster.migrate(db_name="test", migration_path="./migrations")
  • Whether the tool handles concurrent migration attempts across cluster nodes without race conditions.
  • Performance characteristics when applying many migrations to large ClickHouse clusters.
  • Compatibility guarantees with specific ClickHouse server versions.
Same gist for agents: .md · .json

What it is and what it does

clickhouse-migrations is a file-based schema migration tool for ClickHouse that reads versioned SQL files from a directory and applies them in order, tracking which migrations have been run. It supports both the native clickhouse-driver (TCP) and the official clickhouse-connect (HTTP) driver, and is aware of ClickHouse cluster deployments, keeping migration state consistent across all nodes.

You write plain `.sql` files named like `001_init.sql`, `002_add_column.sql`, etc., each containing one or more SQL statements. The tool applies them via CLI commands, a Python API, or CI/CD integration. It can show migration status without applying anything, supports dry-run inspection, and offers optional rollback via paired `.down.sql` files. Multi-statement files and cluster-aware execution distinguish it from simpler alternatives.

Use it for

  • Manage schema changes in production ClickHouse clusters without manual coordination across nodes.
  • Automate database initialization and schema updates in Docker or Kubernetes deployments via CLI.
  • Track and inspect pending vs. applied migrations before running them in CI/CD pipelines.
  • Roll back individual migrations using explicit hand-written down files when needed.
  • Apply complex multi-statement migrations (e.g., table creation plus column additions) atomically.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real problem for ClickHouse users. It is the most actively maintained migration tool for ClickHouse in Python and supports features (multi-statement files, cluster awareness) that alternatives lack. MIT licensing adds no restrictions.

Install

clickhouse-migrations on PyPI

Before you install

Low friction: pure Python wheel with a single runtime dependency (clickhouse-driver). Actively maintained as of 2026-07-08 with recent releases.

Requires a running ClickHouse server accessible at the specified host and port (default 9000 for clickhouse-driver, 8123 for clickhouse-connect).

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal attribution requirements.

Quickstart

pip install clickhouse-migrations

# Create migrations/001_init.sql with SQL statements
clickhouse-migrations --db-host localhost --db-name mydb --migrations-dir ./migrations

# Or in Python:
from clickhouse_migrations.clickhouse_cluster import ClickhouseCluster
cluster = ClickhouseCluster(db_host="localhost")
cluster.migrate(db_name="test", migration_path="./migrations")

Verify before relying

  • Whether the tool handles concurrent migration attempts across cluster nodes without race conditions.
  • Performance characteristics when applying many migrations to large ClickHouse clusters.
  • Compatibility guarantees with specific ClickHouse server versions.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4,>=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
clickhouse-driver
MaintenanceActively maintained 37 days since the last release
Last repo commit
First released
Downloads74,838 / month, #14,784 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Evidence: clickhouse_migrations-0.13.0-py3-none-any.whl

Tags

Capabilities
clickhouse schema migrationsdatabase migration toolsql file versioningclickhouse cluster migrationsddl migration managementclickhouse cli toolmulti-statement migrations
Topics
schema-migrationclickhousedevops
PyPI keywords
clickhousemigrationsmigrationdatabasedatabase-migrationschema-migrationsqlddlolapcli

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “clickhouse schema migrations”

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also clickhouse-sqlalchemy · clickhouse-connect · schemachange · alembic · django-clickhouse-backend · django-clickhouse · openupgradelib · yoyo-migrations · mongodb-migrations · chdb