Skip to content

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

clickhouse: add database type.

spinningbot715b57136510
diff --git a/plugin/db/driver.go b/plugin/db/driver.go
index 06fe02957b..658a4647d8 100644
--- a/plugin/db/driver.go
+++ b/plugin/db/driver.go
@@ -17,24 +17,12 @@ import (
type Type string
const (
- MySQL Type = "MYSQL"
- Postgres Type = "POSTGRES"
- TiDB Type = "TIDB"
+ ClickHouse Type = "CLICKHOUSE"
+ MySQL Type = "MYSQL"
+ Postgres Type = "POSTGRES"
+ TiDB Type = "TIDB"
)
-func (e Type) String() string {
- switch e {
- case MySQL:
- return "MYSQL"
- case Postgres:
- return "POSTGRES"
- case TiDB:
- return "TIDB"
- }
-
- return "UNKNOWN"
-}
-
type DBUser struct {
Name string
Grant string
diff --git a/store/migration/10001__init_schema.sql b/store/migration/10001__init_schema.sql
index 6f40fe22f9..c302e6e206 100644
--- a/store/migration/10001__init_schema.sql
+++ b/store/migration/10001__init_schema.sql
@@ -340,7 +340,7 @@ CREATE TABLE instance (
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
environment_id INTEGER NOT NULL REFERENCES environment (id),
name TEXT NOT NULL,
- `engine` TEXT NOT NULL CHECK (`engine` IN ('MYSQL', 'POSTGRES', 'TIDB')),
+ `engine` TEXT NOT NULL CHECK (`engine` IN ('MYSQL', 'POSTGRES', 'TIDB', 'CLICKHOUSE')),
engine_version TEXT NOT NULL DEFAULT '',
host TEXT NOT NULL,
port TEXT NOT NULL,