Skip to content

Commit e8cb4f6

Browse files
authored
feat: add CockroachDB support (#110)
1 parent d6b1cf1 commit e8cb4f6

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

docs/resources/instance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Optional:
5353
- `database` (String) The database for the instance, you can set this if the engine type is POSTGRES.
5454
- `external_secret` (Block List, Max: 1) The external secret to get the database password. Learn more: https://www.bytebase.com/docs/get-started/instance/#use-external-secret-manager (see [below for nested schema](#nestedblock--data_sources--external_secret))
5555
- `password` (String, Sensitive) The connection user password used by Bytebase to perform DDL and DML operations.
56-
- `ssl_ca` (String, Sensitive) The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.
57-
- `ssl_cert` (String, Sensitive) The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.
58-
- `ssl_key` (String, Sensitive) The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.
56+
- `ssl_ca` (String, Sensitive) The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.
57+
- `ssl_cert` (String, Sensitive) The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.
58+
- `ssl_key` (String, Sensitive) The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.
5959
- `username` (String) The connection user name used by Bytebase to perform DDL and DML operations.
6060

6161
<a id="nestedblock--data_sources--external_secret"></a>

provider/data_source_instance.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func dataSourceInstance() *schema.Resource {
4545
"engine": {
4646
Type: schema.TypeString,
4747
Computed: true,
48-
Description: "The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE.",
48+
Description: "The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE, COCKROACHDB.",
4949
},
5050
"engine_version": {
5151
Type: schema.TypeString,
@@ -113,19 +113,19 @@ func dataSourceInstance() *schema.Resource {
113113
Type: schema.TypeString,
114114
Computed: true,
115115
Sensitive: true,
116-
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
116+
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.",
117117
},
118118
"ssl_cert": {
119119
Type: schema.TypeString,
120120
Computed: true,
121121
Sensitive: true,
122-
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
122+
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.",
123123
},
124124
"ssl_key": {
125125
Type: schema.TypeString,
126126
Computed: true,
127127
Sensitive: true,
128-
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
128+
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.",
129129
},
130130
},
131131
},

provider/data_source_instance_list.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func dataSourceInstanceList() *schema.Resource {
101101
"engine": {
102102
Type: schema.TypeString,
103103
Computed: true,
104-
Description: "The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE.",
104+
Description: "The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE, COCKROACHDB.",
105105
},
106106
"engine_version": {
107107
Type: schema.TypeString,
@@ -169,19 +169,19 @@ func dataSourceInstanceList() *schema.Resource {
169169
Type: schema.TypeString,
170170
Computed: true,
171171
Sensitive: true,
172-
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
172+
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.",
173173
},
174174
"ssl_cert": {
175175
Type: schema.TypeString,
176176
Computed: true,
177177
Sensitive: true,
178-
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
178+
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.",
179179
},
180180
"ssl_key": {
181181
Type: schema.TypeString,
182182
Computed: true,
183183
Sensitive: true,
184-
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
184+
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB, CLICKHOUSE or COCKROACHDB.",
185185
},
186186
},
187187
},

provider/internal/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ var EngineValidation = validation.StringInSlice([]string{
106106
v1pb.Engine_DORIS.String(),
107107
v1pb.Engine_HIVE.String(),
108108
v1pb.Engine_ELASTICSEARCH.String(),
109+
v1pb.Engine_COCKROACHDB.String(),
109110
}, false)
110111

111112
// GetPolicyParentAndType returns the policy parent and type by the name.

provider/resource_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func resourceInstance() *schema.Resource {
6262
Type: schema.TypeString,
6363
Required: true,
6464
ValidateFunc: internal.EngineValidation,
65-
Description: "The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE.",
65+
Description: "The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE, COCKROACHDB.",
6666
},
6767
"engine_version": {
6868
Type: schema.TypeString,

0 commit comments

Comments
 (0)