attr: clickhouse_migrations.__doc__
Project description
Clickhouse Migrator
Clickhouse is known for its scale to store and fetch large datasets.
Development and Maintenance of large-scale db systems many times requires constant changes to the actual DB system. Holding off the scripts to migrate these will be painful.
We found there is nothing existing earlier and developed one inspired by, Flyway, Alembic
This is a python library, which you can execute as a pre-hook using sys python. Or as a migration framework before deployment/server-startup in your application as required.
Installation
You can install from pypi using pip install clickhouse-migrations
.
Usage
from migration_lib.migrate import migrate
migrator = Migrator(db_host, db_user, db_password)
migrator.migrate(db_name, migrations_home, create_db_if_no_exists)
Parameter | Description | Default |
---|---|---|
db_host | Clickhouse database hostname | localhost |
db_user | Clickhouse uesr | **** |
db_password | ***** | **** |
db_name | Clickhouse database name | None |
migrations_home | Path to list of migration files | <project_root> |
create_db_if_no_exists | If the db_name is not present, enabling this will create the db |
True |
Folder and Migration file patterns
The filenames are pretty similar to how flyway
keeps it.
Your first version filename should be prefixed with V1__
(double underscore)
These migrations are executed one by one, failures in between will stop and not further version files will be executed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for clickhouse-migrations-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b9433f79b25833c5043fa577e3efee50358f38aae75db5ba8f12c5fe07ed3b |
|
MD5 | 44c8ba87044353db7ef8043972b6d47b |
|
BLAKE2b-256 | 3489509985a0c8c6bcc51cd5dca0924dbf41cd581fc2fc41c3d937f496700f2a |
Hashes for clickhouse_migrations-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5769373f82835b8fb350e2bb496cdcf753accd340038bcc2416966af9abaf574 |
|
MD5 | 5f31521e61a9d1ebee555dd941148de0 |
|
BLAKE2b-256 | c78a2c987716727b45b697f97922bdc250ff0f42b4fcbcc0dbef62ded0bc1727 |