Clickhouse - Allow schema management for multiple databases within the same cluster. #514
AndresElizondo
started this conversation in
Feature Ideas
Replies: 1 comment
-
Created PR #515. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The main thing keeping us from using dbmate to manage our ClickHouse migrations is that it only supports a single database at a time.
This limits the tables that are written to the
schema.sql
file to only the tables within the current database.What I'm proposing is we add a connection parameter similar to
search_path
that allows for a list of comma-separated database names (like the parameter that exists for PostgreSQL).This would look like:
clickhouse://username:password@127.0.0.1:9000/database_name?search_path=myschema,public
We can then use this list to change the code at https://github.com/amacneil/dbmate/blob/main/pkg/driver/clickhouse/clickhouse.go#L177
From:
SHOW TABLES;
Into something like:
The expected output in the
schema.sql
would then show all tables belonging tomyschema
andpublic
databases.Another way this could addressed would be to have a different
dbmate
folder for each database we want to manage migrations for and run migrations for each separately. (We're trying to move away from this since it can create dependencies between two different dbmate folders)Beta Was this translation helpful? Give feedback.
All reactions