From 03231e27f04207d37ae03f7415f50793b9a17f32 Mon Sep 17 00:00:00 2001 From: ruby Date: Sat, 24 Jan 2026 06:43:10 +0400 Subject: [PATCH 1/5] fix: shebang --- packages/cli/package.json | 2 +- packages/cli/src/cli.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 8764729..38fd5e7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "clisma", - "version": "0.1.1", + "version": "0.1.2", "description": "ClickHouse migration CLI", "author": "github.com/will-work-for-meal", "license": "MIT", diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 019406f..56bace2 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,3 +1,5 @@ +#!/usr/bin/env node + import path from "node:path"; import fs from "node:fs/promises"; import crypto from "node:crypto"; @@ -49,7 +51,6 @@ const parseEnvFile = async ( return parseDotenv(contents); }; - const resolveEnvName = async ( configPath: string, envName?: string, @@ -109,7 +110,10 @@ const runCommand = async ( ); connectionString = envConfig.url; - migrationsDir = path.resolve(path.dirname(configPath), envConfig.migrations.dir); + migrationsDir = path.resolve( + path.dirname(configPath), + envConfig.migrations.dir, + ); // Extract table_name, cluster_name, and replication_path from config tableName = envConfig.migrations.table_name; @@ -184,7 +188,10 @@ program envOverrides, ); - migrationsDir = path.resolve(path.dirname(configPath), envConfig.migrations.dir); + migrationsDir = path.resolve( + path.dirname(configPath), + envConfig.migrations.dir, + ); // Get migration name from flag or prompt let migrationName = options.name; From 3b20a594387f5408ad943720691c9dd2f0c397f9 Mon Sep 17 00:00:00 2001 From: ruby Date: Sat, 24 Jan 2026 06:43:52 +0400 Subject: [PATCH 2/5] docs: upgrade mint --- docs/{cli.md => cli.mdx} | 20 ++++-- .../{env-and-vars.md => env-and-vars.mdx} | 5 +- .../{examples.md => examples.mdx} | 3 +- .../{overview.md => overview.mdx} | 3 +- docs/docs.json | 66 +++++++++++++++++++ docs/favicon.svg | 19 ++++++ ...getting-started.md => getting-started.mdx} | 27 ++++++-- docs/{index.md => index.mdx} | 18 ++--- docs/migrations/{faq.md => faq.mdx} | 10 +-- .../{how-it-works.md => how-it-works.mdx} | 3 +- docs/migrations/{naming.md => naming.mdx} | 3 +- .../{templates.md => templates.mdx} | 3 +- docs/mint.json | 37 ----------- 13 files changed, 149 insertions(+), 68 deletions(-) rename docs/{cli.md => cli.mdx} (71%) rename docs/configuration/{env-and-vars.md => env-and-vars.mdx} (77%) rename docs/configuration/{examples.md => examples.mdx} (88%) rename docs/configuration/{overview.md => overview.mdx} (92%) create mode 100644 docs/docs.json create mode 100644 docs/favicon.svg rename docs/{getting-started.md => getting-started.mdx} (53%) rename docs/{index.md => index.mdx} (56%) rename docs/migrations/{faq.md => faq.mdx} (92%) rename docs/migrations/{how-it-works.md => how-it-works.mdx} (85%) rename docs/migrations/{naming.md => naming.mdx} (65%) rename docs/migrations/{templates.md => templates.mdx} (94%) delete mode 100644 docs/mint.json diff --git a/docs/cli.md b/docs/cli.mdx similarity index 71% rename from docs/cli.md rename to docs/cli.mdx index 5289127..04326a2 100644 --- a/docs/cli.md +++ b/docs/cli.mdx @@ -1,10 +1,14 @@ --- -title: CLI +title: "CLI" +description: "Run, inspect, and create migrations from the command line" --- -Clisma ships a CLI for applying and inspecting migrations. + + **Prerequisites**: + - A `clisma.hcl` config file in the current directory, or pass `--config` + -The CLI requires a config file. Use `--config` or place `clisma.hcl` in the current directory. +Clisma ships a CLI for applying and inspecting migrations. ## Commands @@ -59,5 +63,13 @@ clisma checksum ./migrations/20240101123045_create_users.sql Example: `--var ttl_days=30 --var replication_factor=3` - **`--env-file ` — load env vars from file.** - + Example: `--env-file .env` + +## Advanced usage + +Run with a custom config path and multiple variables: + +```bash +clisma run --config ./infra/clisma.hcl --env staging --var ttl_days=30 --var replication_factor=2 +``` diff --git a/docs/configuration/env-and-vars.md b/docs/configuration/env-and-vars.mdx similarity index 77% rename from docs/configuration/env-and-vars.md rename to docs/configuration/env-and-vars.mdx index 2dd44bf..33739b7 100644 --- a/docs/configuration/env-and-vars.md +++ b/docs/configuration/env-and-vars.mdx @@ -1,5 +1,6 @@ --- -title: env() and Variables +title: "env() and variables" +description: "Use environment variables and config variables in clisma.hcl" --- ## env() @@ -40,7 +41,7 @@ env "local" { ## Cluster name -If you want migrations_table to be replicated and use cluster-aware templates, set +If you want the migrations table to be replicated and use cluster-aware templates, set `cluster_name` in the environment: ```hcl diff --git a/docs/configuration/examples.md b/docs/configuration/examples.mdx similarity index 88% rename from docs/configuration/examples.md rename to docs/configuration/examples.mdx index 7f827b9..1d349a6 100644 --- a/docs/configuration/examples.md +++ b/docs/configuration/examples.mdx @@ -1,5 +1,6 @@ --- -title: Examples +title: "Examples" +description: "Common clisma.hcl configurations for local and production" --- ## Local diff --git a/docs/configuration/overview.md b/docs/configuration/overview.mdx similarity index 92% rename from docs/configuration/overview.md rename to docs/configuration/overview.mdx index f1c49fd..728e01f 100644 --- a/docs/configuration/overview.md +++ b/docs/configuration/overview.mdx @@ -1,5 +1,6 @@ --- -title: Configuration Overview +title: "Configuration overview" +description: "Define environments and migration settings in clisma.hcl" --- Clisma uses an HCL config file to define environments and migration settings. diff --git a/docs/docs.json b/docs/docs.json new file mode 100644 index 0000000..4a01926 --- /dev/null +++ b/docs/docs.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://mintlify.com/docs.json", + "theme": "aspen", + "name": "clisma", + "colors": { + "primary": "#16A34A", + "light": "#07C983", + "dark": "#15803D" + }, + "favicon": "/favicon.svg", + "navigation": { + "tabs": [ + { + "tab": "Guides", + "groups": [ + { + "group": "Getting started", + "pages": [ + "index", + "getting-started" + ] + }, + { + "group": "Configuration", + "pages": [ + "configuration/overview", + "configuration/env-and-vars", + "configuration/examples" + ] + }, + { + "group": "Migrations", + "pages": [ + "migrations/how-it-works", + "migrations/templates", + "migrations/naming", + "migrations/faq" + ] + }, + { + "group": "CLI", + "pages": [ + "cli" + ] + } + ] + } + ] + }, + "logo": { + "light": "/logo/light.svg", + "dark": "/logo/dark.svg" + }, + "contextual": { + "options": [ + "copy", + "view", + "chatgpt", + "claude", + "perplexity", + "mcp", + "cursor", + "vscode" + ] + } +} diff --git a/docs/favicon.svg b/docs/favicon.svg new file mode 100644 index 0000000..b785c73 --- /dev/null +++ b/docs/favicon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/getting-started.md b/docs/getting-started.mdx similarity index 53% rename from docs/getting-started.md rename to docs/getting-started.mdx index 12de2c8..f136639 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.mdx @@ -1,7 +1,14 @@ --- -title: Getting Started +title: "Getting started" +description: "Install clisma and run your first ClickHouse migration" --- + + **Prerequisites**: + - Access to a ClickHouse instance and credentials + - A project directory where you can add `clisma.hcl` + + clisma is a ClickHouse migration tool with templating support and environment configuration. ## Installation @@ -18,7 +25,8 @@ npm install -g clisma ## Quickstart -### 1. Create a config + + Create `clisma.hcl` in your project root: @@ -31,26 +39,33 @@ env "local" { } } ``` + -### 2. Create your first migration + ```bash clisma create ``` + -### 3. Run it + ```bash clisma run --env local ``` + -### 4. Check status + ```bash clisma status --env local ``` + + + +## Advanced usage -You can also pass config variables and load environment files: +You can pass variables and load environment files when you run migrations: ```bash clisma run --env local --var ttl_days=30 --env-file .env diff --git a/docs/index.md b/docs/index.mdx similarity index 56% rename from docs/index.md rename to docs/index.mdx index 44cebdc..40174b5 100644 --- a/docs/index.md +++ b/docs/index.mdx @@ -1,11 +1,10 @@ --- -title: clisma +title: "Clisma" +description: "Overview of the ClickHouse migration tool and how you use it" --- Clisma is a ClickHouse migration tool with templating support and environment configuration. -Think of it as a tiny, pragmatic CLI for migrations with a bit of templating sugar. - -Use the CLI for day-to-day workflows, or the core package for programmatic control. +You use the CLI for day-to-day workflows, or the core package for programmatic control. ## What it does @@ -15,12 +14,12 @@ Use the CLI for day-to-day workflows, or the core package for programmatic contr ## Inspiration -This project borrows ideas from tools we like: +This project borrows ideas from tools you may already know: - [Prisma](https://www.prisma.io/) for the simple, friendly CLI experience. -- [Atlas](https://atlasgo.io/) for the idea of templated migrations and config-driven environments. +- [Atlas](https://atlasgo.io/) for templated migrations and config-driven environments. -For Atlas, the inspiration is templated migrations and environment config: +Related Atlas concepts: - [Templated migrations](https://atlasgo.io/concepts/migrations#template) - [Environment configuration](https://atlasgo.io/concepts/dev-database) @@ -32,5 +31,6 @@ For Atlas, the inspiration is templated migrations and environment config: ## Next steps -- Install the CLI and run your first migration. -- Set up `clisma.hcl` with `migrations` and variables. +- Follow the [Getting started](./getting-started) guide. +- Define your environments in [Configuration](./configuration/overview). +- Learn about [Templates](./migrations/templates) for advanced SQL. diff --git a/docs/migrations/faq.md b/docs/migrations/faq.mdx similarity index 92% rename from docs/migrations/faq.md rename to docs/migrations/faq.mdx index 2ec00b5..7c9fb0a 100644 --- a/docs/migrations/faq.md +++ b/docs/migrations/faq.mdx @@ -1,8 +1,8 @@ --- -title: FAQ +title: "FAQ" +description: "Answers to common questions about clisma migrations" --- - ## Custom table name You can override the table name in config: @@ -38,7 +38,7 @@ env "production" { Default replication path: -```sh +```text /clickhouse/tables/cluster-{cluster}/shard-{shard}/{database}/${migrations.table_name} ``` @@ -52,7 +52,7 @@ If `cluster_name` is not set in config and ClickHouse reports configured cluster stops and asks you to set `cluster_name`. If there are no clusters, it uses `ReplacingMergeTree()` in standalone mode. -## Does clisma support Down migrations? +## Does clisma support down migrations? No. This is intentional. ClickHouse DDL and data changes are often non-transactional and may be irreversible. Reliable rollbacks are hard to @@ -60,7 +60,7 @@ guarantee and can introduce more risk than they remove. The expected workflow is to apply new forward migrations that correct or compensate for previous changes. -## Does clisma support Multi-statement migrations? +## Does clisma support multi-statement migrations? Yes. You can include multiple SQL statements in one file. Separate statements with semicolons; clisma splits them outside of strings and comments. diff --git a/docs/migrations/how-it-works.md b/docs/migrations/how-it-works.mdx similarity index 85% rename from docs/migrations/how-it-works.md rename to docs/migrations/how-it-works.mdx index c33156d..5a0eac6 100644 --- a/docs/migrations/how-it-works.md +++ b/docs/migrations/how-it-works.mdx @@ -1,5 +1,6 @@ --- -title: How Migrations Work +title: "How migrations work" +description: "Understand how clisma tracks and validates migrations" --- ## Migrations table diff --git a/docs/migrations/naming.md b/docs/migrations/naming.mdx similarity index 65% rename from docs/migrations/naming.md rename to docs/migrations/naming.mdx index 65d44d8..b412307 100644 --- a/docs/migrations/naming.md +++ b/docs/migrations/naming.mdx @@ -1,5 +1,6 @@ --- -title: Naming and Ordering +title: "Naming and ordering" +description: "Follow the required migration filename format" --- Migration files must follow this pattern: diff --git a/docs/migrations/templates.md b/docs/migrations/templates.mdx similarity index 94% rename from docs/migrations/templates.md rename to docs/migrations/templates.mdx index e66459d..a2e261a 100644 --- a/docs/migrations/templates.md +++ b/docs/migrations/templates.mdx @@ -1,5 +1,6 @@ --- -title: Templates +title: "Templates" +description: "Use Handlebars variables in migrations to adapt across environments" --- Template variables come from `migrations.vars` in your config. If you set diff --git a/docs/mint.json b/docs/mint.json deleted file mode 100644 index f449973..0000000 --- a/docs/mint.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "clisma", - "logo": "/logo.svg", - "favicon": "/favicon.svg", - "navigation": [ - { - "group": "Getting Started", - "pages": [ - "index", - "getting-started" - ] - }, - { - "group": "Configuration", - "pages": [ - "configuration/overview", - "configuration/env-and-vars", - "configuration/examples" - ] - }, - { - "group": "Migrations", - "pages": [ - "migrations/how-it-works", - "migrations/templates", - "migrations/naming", - "migrations/faq" - ] - }, - { - "group": "CLI", - "pages": [ - "cli" - ] - } - ] -} From dd00d1cdd44e7139ee9d4877b933a9bac697158a Mon Sep 17 00:00:00 2001 From: jgfhkjtdyj Date: Sat, 24 Jan 2026 06:10:51 +0300 Subject: [PATCH 3/5] Documentation edits made through Mintlify web editor --- docs/cli.mdx | 17 +++-- docs/configuration/env-and-vars.mdx | 1 + docs/configuration/examples.mdx | 3 +- docs/configuration/overview.mdx | 5 +- docs/docs.json | 5 +- docs/index.mdx | 11 ++- .../{getting-started.mdx => installation.mdx} | 69 +++++++++---------- docs/migrations/faq.mdx | 31 +++------ docs/migrations/how-it-works.mdx | 1 + docs/migrations/naming.mdx | 3 +- docs/migrations/templates.mdx | 1 + 11 files changed, 68 insertions(+), 79 deletions(-) rename docs/{getting-started.mdx => installation.mdx} (52%) diff --git a/docs/cli.mdx b/docs/cli.mdx index 04326a2..7ed5397 100644 --- a/docs/cli.mdx +++ b/docs/cli.mdx @@ -1,10 +1,12 @@ --- -title: "CLI" +title: "Commands" description: "Run, inspect, and create migrations from the command line" +icon: "terminal" --- **Prerequisites**: + - A `clisma.hcl` config file in the current directory, or pass `--config` @@ -50,19 +52,16 @@ clisma checksum ./migrations/20240101123045_create_users.sql ## Flags -- **`--env ` — environment from config file.** +- **`--env — environment from config file.`** Example: `--env production` - -- **`--config ` — path to config file.** +- **`--config — path to config file.`** Example: `--config ./clisma.hcl` - -- **`--var ` — set variable value (repeatable).** +- **`--var — set variable value (repeatable).`** Example: `--var ttl_days=30 --var replication_factor=3` - -- **`--env-file ` — load env vars from file.** +- **`--env-file — load env vars from file.`** Example: `--env-file .env` @@ -72,4 +71,4 @@ Run with a custom config path and multiple variables: ```bash clisma run --config ./infra/clisma.hcl --env staging --var ttl_days=30 --var replication_factor=2 -``` +``` \ No newline at end of file diff --git a/docs/configuration/env-and-vars.mdx b/docs/configuration/env-and-vars.mdx index 33739b7..5d09417 100644 --- a/docs/configuration/env-and-vars.mdx +++ b/docs/configuration/env-and-vars.mdx @@ -1,6 +1,7 @@ --- title: "env() and variables" description: "Use environment variables and config variables in clisma.hcl" +icon: "book-open-cover" --- ## env() diff --git a/docs/configuration/examples.mdx b/docs/configuration/examples.mdx index 1d349a6..f5ab7a9 100644 --- a/docs/configuration/examples.mdx +++ b/docs/configuration/examples.mdx @@ -1,6 +1,7 @@ --- title: "Examples" description: "Common clisma.hcl configurations for local and production" +icon: "notes-medical" --- ## Local @@ -53,4 +54,4 @@ variable "replication_factor" { type = string default = "3" } -``` +``` \ No newline at end of file diff --git a/docs/configuration/overview.mdx b/docs/configuration/overview.mdx index 728e01f..a2829c8 100644 --- a/docs/configuration/overview.mdx +++ b/docs/configuration/overview.mdx @@ -1,6 +1,7 @@ --- -title: "Configuration overview" +title: "clisma.hcl" description: "Define environments and migration settings in clisma.hcl" +icon: "file-pen" --- Clisma uses an HCL config file to define environments and migration settings. @@ -62,4 +63,4 @@ variable "ttl_days" { default = "30" description = "Default TTL" } -``` +``` \ No newline at end of file diff --git a/docs/docs.json b/docs/docs.json index 4a01926..77851f9 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -15,13 +15,15 @@ "groups": [ { "group": "Getting started", + "icon": "rocket-launch", "pages": [ "index", - "getting-started" + "installation" ] }, { "group": "Configuration", + "icon": "database", "pages": [ "configuration/overview", "configuration/env-and-vars", @@ -39,6 +41,7 @@ }, { "group": "CLI", + "icon": "game-console-handheld", "pages": [ "cli" ] diff --git a/docs/index.mdx b/docs/index.mdx index 40174b5..eef3d94 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -1,10 +1,10 @@ --- -title: "Clisma" +title: "What is clisma" description: "Overview of the ClickHouse migration tool and how you use it" +icon: "hand-wave" --- -Clisma is a ClickHouse migration tool with templating support and environment configuration. -You use the CLI for day-to-day workflows, or the core package for programmatic control. +Clisma is a ClickHouse migration tool with templating support and environment configuration. You use the CLI for day-to-day workflows, or the core package for programmatic control. ## What it does @@ -26,11 +26,10 @@ Related Atlas concepts: > Why the weird name? > -> It is a little joke: ClickHouse + Prisma -> clisma. There is no full schema -> management here (yet), but the vibe is similar. +> It is a little joke: ClickHouse + Prisma -\> clisma. There is no full schema management here (yet), but the vibe is similar. ## Next steps - Follow the [Getting started](./getting-started) guide. - Define your environments in [Configuration](./configuration/overview). -- Learn about [Templates](./migrations/templates) for advanced SQL. +- Learn about [Templates](./migrations/templates) for advanced SQL. \ No newline at end of file diff --git a/docs/getting-started.mdx b/docs/installation.mdx similarity index 52% rename from docs/getting-started.mdx rename to docs/installation.mdx index f136639..c1096dc 100644 --- a/docs/getting-started.mdx +++ b/docs/installation.mdx @@ -1,10 +1,12 @@ --- -title: "Getting started" +title: "Installation and Quickstart" description: "Install clisma and run your first ClickHouse migration" +icon: "play" --- **Prerequisites**: + - Access to a ClickHouse instance and credentials - A project directory where you can add `clisma.hcl` @@ -26,41 +28,34 @@ npm install -g clisma ## Quickstart - - -Create `clisma.hcl` in your project root: - -```hcl -env "local" { - url = "http://default:password@localhost:8123/mydb" - - migrations { - dir = "migrations/clickhouse" - } -} -``` - - - - -```bash -clisma create -``` - - - - -```bash -clisma run --env local -``` - - - - -```bash -clisma status --env local -``` - + + Create `clisma.hcl` in your project root: + + ```hcl + env "local" { + url = "http://default:password@localhost:8123/mydb" + + migrations { + dir = "migrations/clickhouse" + } + } + ``` + + + ```bash + clisma create + ``` + + + ```bash + clisma run --env local + ``` + + + ```bash + clisma status --env local + ``` + ## Advanced usage @@ -69,4 +64,4 @@ You can pass variables and load environment files when you run migrations: ```bash clisma run --env local --var ttl_days=30 --env-file .env -``` +``` \ No newline at end of file diff --git a/docs/migrations/faq.mdx b/docs/migrations/faq.mdx index 7c9fb0a..f25382d 100644 --- a/docs/migrations/faq.mdx +++ b/docs/migrations/faq.mdx @@ -1,6 +1,7 @@ --- title: "FAQ" description: "Answers to common questions about clisma migrations" +icon: "question" --- ## Custom table name @@ -20,8 +21,7 @@ env "local" { ## Custom replication path -In clustered setups you can override the migrations table replication path used by -`ReplicatedReplacingMergeTree(...)`: +In clustered setups you can override the migrations table replication path used by `ReplicatedReplacingMergeTree(...)`: ```hcl env "production" { @@ -44,34 +44,21 @@ Default replication path: ### Summary -If `env.cluster_name` is set, clisma treats the environment as clustered and -creates the migrations table using `ReplicatedReplacingMergeTree(...)` with -`ON CLUSTER ""`. +If `env.cluster_name` is set, clisma treats the environment as clustered and creates the migrations table using `ReplicatedReplacingMergeTree(...)` with `ON CLUSTER ""`. -If `cluster_name` is not set in config and ClickHouse reports configured clusters, clisma -stops and asks you to set `cluster_name`. If there are no clusters, it uses -`ReplacingMergeTree()` in standalone mode. +If `cluster_name` is not set in config and ClickHouse reports configured clusters, clisma stops and asks you to set `cluster_name`. If there are no clusters, it uses `ReplacingMergeTree()` in standalone mode. ## Does clisma support down migrations? -No. This is intentional. ClickHouse DDL and data changes are often -non-transactional and may be irreversible. Reliable rollbacks are hard to -guarantee and can introduce more risk than they remove. The expected workflow -is to apply new forward migrations that correct or compensate for previous -changes. +No. This is intentional. ClickHouse DDL and data changes are often non-transactional and may be irreversible. Reliable rollbacks are hard to guarantee and can introduce more risk than they remove. The expected workflow is to apply new forward migrations that correct or compensate for previous changes. ## Does clisma support multi-statement migrations? -Yes. You can include multiple SQL statements in one file. Separate statements with -semicolons; clisma splits them outside of strings and comments. +Yes. You can include multiple SQL statements in one file. Separate statements with semicolons; clisma splits them outside of strings and comments. ## Checksum mismatch -If a migration file changes after being applied, clisma will fail with a -checksum mismatch. You have two options: +If a migration file changes after being applied, clisma will fail with a checksum mismatch. You have two options: -- Revert the migration file back to the applied version and create a new - forward migration. -- If you really need to override the checksum, update the stored checksum in - the migrations table (use `clisma checksum `). This is risky - and should only be done if you fully understand the consequences. +- Revert the migration file back to the applied version and create a new forward migration. +- If you really need to override the checksum, update the stored checksum in the migrations table (use `clisma checksum `). This is risky and should only be done if you fully understand the consequences. \ No newline at end of file diff --git a/docs/migrations/how-it-works.mdx b/docs/migrations/how-it-works.mdx index 5a0eac6..7bdf6fd 100644 --- a/docs/migrations/how-it-works.mdx +++ b/docs/migrations/how-it-works.mdx @@ -1,6 +1,7 @@ --- title: "How migrations work" description: "Understand how clisma tracks and validates migrations" +icon: "diagram-subtask" --- ## Migrations table diff --git a/docs/migrations/naming.mdx b/docs/migrations/naming.mdx index b412307..6f4df4f 100644 --- a/docs/migrations/naming.mdx +++ b/docs/migrations/naming.mdx @@ -1,6 +1,7 @@ --- title: "Naming and ordering" description: "Follow the required migration filename format" +icon: "tag" --- Migration files must follow this pattern: @@ -12,4 +13,4 @@ YYYYMMDDhhmmss_.sql Examples: - `20240101123045_create_users.sql` -- `20240214104500_add_index.sql` +- `20240214104500_add_index.sql` \ No newline at end of file diff --git a/docs/migrations/templates.mdx b/docs/migrations/templates.mdx index a2e261a..d6bfe93 100644 --- a/docs/migrations/templates.mdx +++ b/docs/migrations/templates.mdx @@ -1,6 +1,7 @@ --- title: "Templates" description: "Use Handlebars variables in migrations to adapt across environments" +icon: "notes-medical" --- Template variables come from `migrations.vars` in your config. If you set From b9bb99bfff3a2195713f4179bb374e327d612cd4 Mon Sep 17 00:00:00 2001 From: ruby Date: Sat, 24 Jan 2026 07:20:33 +0400 Subject: [PATCH 4/5] docs: update readme --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bebc406..48a1441 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ **A ClickHouse migrations CLI with templated SQL and environment-aware config.** -_"clisma" is a mashup of ClickHouse + Prisma. A dumb pun, but it stuck._ +![NPM Version](https://img.shields.io/npm/v/clisma) +![GitHub top language](https://img.shields.io/github/languages/top/will-work-for-meal/clisma) +![GitHub Repo stars](https://img.shields.io/github/stars/will-work-for-meal/clisma) -This project borrows ideas from tools we like: - -- **[Atlas](https://atlasgo.io/)** for the idea of [templated migrations](https://atlasgo.io/concepts/migrations#template) and [config-driven environments](https://atlasgo.io/concepts/dev-database). +_"clisma" is a mashup of ClickHouse + Prisma. A dumb pun, but it stuck._ 👉👈 -- **[Prisma](https://www.prisma.io/)** for the simple, friendly CLI experience. +

See full detailed (fancy!) Docs →

-### So why it exists? +## What is for? - **Templates in migrations** — Atlas has this, but it is paid; clisma keeps it simple and open. - **Multi-statement migrations** — write real SQL without splitting into tiny files. @@ -136,3 +136,11 @@ Example with variables and env file: ```bash clisma run --env local --var ttl_days=30 --env-file .env ``` + +## So What is this + +This project borrows ideas from tools we like: + +- **[Atlas](https://atlasgo.io/)** for the idea of [templated migrations](https://atlasgo.io/concepts/migrations#template) and [config-driven environments](https://atlasgo.io/concepts/dev-database). + +- **[Prisma](https://www.prisma.io/)** for the simple, friendly CLI experience. From 46f9a05e428d86564cb2102c45ba2a5945196a90 Mon Sep 17 00:00:00 2001 From: ruby Date: Sat, 24 Jan 2026 07:24:06 +0400 Subject: [PATCH 5/5] docs: update readme --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 48a1441..3a74f9e 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,9 @@ **A ClickHouse migrations CLI with templated SQL and environment-aware config.** -![NPM Version](https://img.shields.io/npm/v/clisma) -![GitHub top language](https://img.shields.io/github/languages/top/will-work-for-meal/clisma) -![GitHub Repo stars](https://img.shields.io/github/stars/will-work-for-meal/clisma) - _"clisma" is a mashup of ClickHouse + Prisma. A dumb pun, but it stuck._ 👉👈 -

See full detailed (fancy!) Docs →

+

💅 More Docs →

## What is for?