Skip to content

Commit dff5009

Browse files
committed
feat: add support for cockroachdb
1 parent e0d8644 commit dff5009

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

server/constants/db_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ const (
2121
DbTypeCassandraDB = "cassandradb"
2222
// DbTypeScyllaDB is the scylla database type
2323
DbTypeScyllaDB = "scylladb"
24+
// DbTypeCockroachDB is the cockroach database type
25+
DbTypeCockroachDB = "cockroachdb"
2426
)

server/db/providers/sql/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func NewProvider() (*provider, error) {
4646
dbURL := memorystore.RequiredEnvStoreObj.GetRequiredEnv().DatabaseURL
4747

4848
switch dbType {
49-
case constants.DbTypePostgres, constants.DbTypeYugabyte:
49+
case constants.DbTypePostgres, constants.DbTypeYugabyte, constants.DbTypeCockroachDB:
5050
sqlDB, err = gorm.Open(postgres.Open(dbURL), ormConfig)
5151
case constants.DbTypeSqlite:
5252
sqlDB, err = gorm.Open(sqlite.Open(dbURL), ormConfig)

0 commit comments

Comments
 (0)