Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Add connection info note for ClickHouse

天舟f8671de54024
diff --git a/frontend/src/components/InstanceForm.vue b/frontend/src/components/InstanceForm.vue
index 1ff173883b..5281473e61 100644
--- a/frontend/src/components/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm.vue
@@ -223,7 +223,6 @@ input[type="number"] {
>
<template
v-if="
- state.instance.engine == 'CLICKHOUSE' ||
state.instance.engine == 'MYSQL' ||
state.instance.engine == 'TIDB'
"
@@ -232,6 +231,19 @@ input[type="number"] {
<span class="text-red-600">YOUR_DB_PWD</span> and grant the user
with the needed privileges.
</template>
+ <template v-else-if="state.instance.engine == 'CLICKHOUSE'">
+ Below is an example to create user 'bytebase' with password
+ <span class="text-red-600">YOUR_DB_PWD</span> and grant the user
+ with the needed privileges. First you need to enable
+ <a
+ class="normal-link"
+ href="https://clickhouse.com/docs/en/operations/access-rights/#access-control-usage"
+ target="__blank"
+ >
+ ClickHouse SQL-driven workflow</a
+ >
+ and then run the following query to create the user.
+ </template>
<template v-if="state.instance.engine == 'POSTGRES'">
<BBAttention
class="mb-1"
@@ -573,6 +585,7 @@ export default {
const grantStatement = (type: EngineType): string => {
switch (type) {
case "CLICKHOUSE":
+ return "CREATE USER bytebase IDENTIFIED BY 'YOUR_DB_PWD';\n\nGRANT ALL ON *.* TO bytebase WITH GRANT OPTION;";
case "MYSQL":
case "TIDB":
return "CREATE USER bytebase@'%' IDENTIFIED BY 'YOUR_DB_PWD';\n\nGRANT ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE VIEW, \nDELETE, DROP, EXECUTE, INDEX, INSERT, PROCESS, REFERENCES, \nSELECT, SHOW DATABASES, SHOW VIEW, TRIGGER, UPDATE, USAGE \nON *.* to bytebase@'%';";