Clicksuite is a robust CLI and programmatic tool designed for managing ClickHouse database migrations. It supports environment-specific configurations, allowing for separate SQL definitions across development, test, and production environments. Key features include multi-statement migration support, environment variable interpolation for secure credential management (e.g., `${ENV_VAR}`), automatic `schema.sql` generation for multi-database schema tracking, and a dry-run mode for previewing migrations. The tool also provides verbose logging control and comprehensive migration management commands (apply, rollback, reset, status). It is currently at version 1.7.4, with a steady release cadence addressing fixes and adding features like programmatic usage settings and multi-statement support. It ships with full TypeScript types, making it suitable for modern JavaScript and TypeScript projects.
npm install clicksuiteVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage of Clicksuite to apply migrations, configuring connection details and paths using environment variables.
Update your programmatic configuration to use `migrationsDatabase` instead of `database` for specifying the database where migration tracking tables reside.
Upgrade your Node.js environment to version 16 or newer. Use `nvm` or similar tools for managing Node.js versions easily.
Verify that `CLICKHOUSE_URL` is correctly set in your `.env` file (e.g., `CLICKHOUSE_URL=http://default@localhost:8123/my_database`) and accessible by the process running Clicksuite.
Check if your ClickHouse instance is running and accessible from where Clicksuite is executed. Verify the `CLICKHOUSE_URL` environment variable for correct host, port, and credentials. Ensure no firewalls are blocking the connection.
Run `clicksuite init` to create the default migrations directory and the `__clicksuite_migrations` table. If using a custom directory, ensure `CLICKSUITE_MIGRATIONS_DIR` is correctly set and the directory exists.
Run `clicksuite init` to initialize the project and create the necessary tracking table. If using a custom database for migrations, ensure `CLICKSUITE_MIGRATIONS_DATABASE` is correctly configured.
No dependency data recorded yet.