Skip to main content

Database Migrations for ClickHouse.

Project description

Houseplant: Database Migrations for ClickHouse

PyPI version image image

Houseplant is a CLI tool that helps you manage database migrations for ClickHouse.


Here's how you can manage your ClickHouse migrations.

$ houseplant init
✨ Project initialized successfully!

$ houseplant generate "add events"
✨ Generated migration: ch/migrations/20240101000000_add_events.yml

$ houseplant migrate:status
Database: june_development

┏━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Status ┃ Migration ID   ┃ Migration Name ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│   up   │ 20240101000000 │ add events     │
└────────┴────────────────┴────────────────┘

$ houseplant migrate
✓ Applied migration 20241121003230_add_events.yml

$ houseplant migrate:up VERSION=20241121003230
✓ Applied migration 20241121003230_add_events.yml

$ houseplant migrate:down VERSION=20241121003230
✓ Rolled back migration 20241121003230_add_events.yml

Why Houseplant?

  • Schema Management: Houseplant automatically tracks and manages your ClickHouse schema changes, making it easy to evolve your data model over time
  • Developer Experience: Write migrations in YAML format, making them easy to read, review, and maintain
  • Environment Support: Different configurations for development, testing, and production environments
  • Rich CLI: Comes with an intuitive command-line interface for all migration operations

Installation

You can install Houseplant using pip:

$ pip install houseplant

Configuration

Houseplant uses the following environment variables to connect to your ClickHouse instance:

  • HOUSEPLANT_ENV: The current environment
  • CLICKHOUSE_HOST: Host address of your ClickHouse server (default: "localhost")
  • CLICKHOUSE_PORT: Port number for ClickHouse (default: 9000)
  • CLICKHOUSE_DB: Database name (default: "development")
  • CLICKHOUSE_USER: Username for authentication (default: "default")
  • CLICKHOUSE_PASSWORD: Password for authentication (default: "")
  • CLICKHOUSE_SECURE: Enable secure connection via the secure flag of ClickHouse client (default: False)
  • CLICKHOUSE_VERIFY: Enable certificate verifiaction verify flag of ClickHouse client (default: False)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

houseplant-0.2.5.tar.gz (298.6 kB view details)

Uploaded Source

Built Distribution

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

houseplant-0.2.5-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file houseplant-0.2.5.tar.gz.

File metadata

  • Download URL: houseplant-0.2.5.tar.gz
  • Upload date:
  • Size: 298.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for houseplant-0.2.5.tar.gz
Algorithm Hash digest
SHA256 1ea20288e44738b091836c80b8ce4b1bdfc7edc9044895e3835b7edb8c0a051a
MD5 c95b59a517e06876e06ea0492066c514
BLAKE2b-256 bee17a29d5c0b182ecb6a5b4e44adfffc68a91dbee727684f82ba44b8f99b587

See more details on using hashes here.

Provenance

The following attestation bundles were made for houseplant-0.2.5.tar.gz:

Publisher: release.yml on juneHQ/houseplant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file houseplant-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: houseplant-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for houseplant-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fe45a3b00e5642a02acd725bd8e5c05aa2322da750b699be0a4ae08d1247c6da
MD5 a78e66d2a64e1cbd532e7dcb5b160fcd
BLAKE2b-256 4d44db2311424f2a1d0526796164f2878385daeb93f0f424c290f023e229b73f

See more details on using hashes here.

Provenance

The following attestation bundles were made for houseplant-0.2.5-py3-none-any.whl:

Publisher: release.yml on juneHQ/houseplant

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