Skip to content

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

chore: restruct connection context (#10063)

Danny Xu688503843ec2
diff --git a/backend/bin/bb/cmd/utils.go b/backend/bin/bb/cmd/utils.go
index 5b811f2c6e..3b0411aa02 100644
--- a/backend/bin/bb/cmd/utils.go
+++ b/backend/bin/bb/cmd/utils.go
@@ -67,7 +67,6 @@ func open(ctx context.Context, u *dburl.URL) (db.Driver, error) {
SslKey: u.Query().Get("ssl-key"),
},
},
- db.ConnectionContext{},
)
if err != nil {
return nil, errors.Wrap(err, "failed to open database")
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index 4fcabb65a5..174cd5920a 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -196,10 +196,10 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.Ins
SSHConfig: sshConfig,
ReadOnly: readOnly,
SchemaTenantMode: schemaTenantMode,
- },
- db.ConnectionContext{
- InstanceID: instance.ResourceID,
- EngineVersion: instance.EngineVersion,
+ ConnectionContext: db.ConnectionContext{
+ InstanceID: instance.ResourceID,
+ EngineVersion: instance.EngineVersion,
+ },
},
)
if err != nil {
diff --git a/backend/demo/demo.go b/backend/demo/demo.go
index df73d2af92..95d8562c5b 100644
--- a/backend/demo/demo.go
+++ b/backend/demo/demo.go
@@ -36,7 +36,6 @@ func LoadDemoDataIfNeeded(ctx context.Context, storeDB *store.DB, pgBinDir, demo
storepb.Engine_POSTGRES,
dbdriver.DriverConfig{DbBinDir: pgBinDir},
storeDB.ConnCfg,
- dbdriver.ConnectionContext{},
)
if err != nil {
return err
diff --git a/backend/migrator/migrator.go b/backend/migrator/migrator.go
index d9f01a028a..abc3cd045b 100644
--- a/backend/migrator/migrator.go
+++ b/backend/migrator/migrator.go
@@ -35,7 +35,6 @@ func MigrateSchema(ctx context.Context, storeDB *store.DB, pgBinDir, serverVersi
storepb.Engine_POSTGRES,
dbdriver.DriverConfig{DbBinDir: pgBinDir},
storeDB.ConnCfg,
- dbdriver.ConnectionContext{},
)
if err != nil {
return nil, err
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 14fa00c8c1..b75aaba355 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -163,7 +163,6 @@ func TestMigrationCompatibility(t *testing.T) {
storepb.Engine_POSTGRES,
dbdriver.DriverConfig{DbBinDir: pgBinDir},
connCfg,
- dbdriver.ConnectionContext{},
)
require.NoError(t, err)
defer defaultDriver.Close(ctx)
@@ -179,7 +178,6 @@ func TestMigrationCompatibility(t *testing.T) {
storepb.Engine_POSTGRES,
dbdriver.DriverConfig{DbBinDir: pgBinDir},
metadataConnConfig,
- dbdriver.ConnectionContext{},
)
require.NoError(t, err)
diff --git a/backend/plugin/advisor/utils_for_tests.go b/backend/plugin/advisor/utils_for_tests.go
index dfee84d382..3d6046caf9 100644
--- a/backend/plugin/advisor/utils_for_tests.go
+++ b/backend/plugin/advisor/utils_for_tests.go
@@ -216,7 +216,7 @@ type MockDriver struct {
}
// Open implements the Driver interface.
-func (d *MockDriver) Open(_ context.Context, _ storepb.Engine, _ database.ConnectionConfig, _ database.ConnectionContext) (database.Driver, error) {
+func (d *MockDriver) Open(_ context.Context, _ storepb.Engine, _ database.ConnectionConfig) (database.Driver, error) {
return d, nil
}
diff --git a/backend/plugin/db/clickhouse/clickhouse.go b/backend/plugin/db/clickhouse/clickhouse.go
index 7ebb145143..3c35253e29 100644
--- a/backend/plugin/db/clickhouse/clickhouse.go
+++ b/backend/plugin/db/clickhouse/clickhouse.go
@@ -57,7 +57,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a ClickHouse driver.
-func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
addr := fmt.Sprintf("%s:%s", config.Host, config.Port)
// Set SSL configuration.
tlsConfig, err := config.TLSConfig.GetSslConfig()
@@ -83,14 +83,14 @@ func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.C
slog.Debug("Opening ClickHouse driver",
slog.String("addr", addr),
- slog.String("environment", connCtx.EnvironmentID),
- slog.String("database", connCtx.InstanceID),
+ slog.String("environment", config.ConnectionContext.EnvironmentID),
+ slog.String("database", config.ConnectionContext.InstanceID),
)
driver.dbType = dbType
driver.db = conn
driver.databaseName = config.Database
- driver.connectionCtx = connCtx
+ driver.connectionCtx = config.ConnectionContext
return driver, nil
}
diff --git a/backend/plugin/db/dm/dm.go b/backend/plugin/db/dm/dm.go
index 72b4bf30af..63be5fbae0 100644
--- a/backend/plugin/db/dm/dm.go
+++ b/backend/plugin/db/dm/dm.go
@@ -43,7 +43,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a DM driver.
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, _ db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
port, err := strconv.Atoi(config.Port)
if err != nil {
return nil, errors.Errorf("invalid port %q", config.Port)
diff --git a/backend/plugin/db/driver.go b/backend/plugin/db/driver.go
index 162eab80b7..94281e3141 100644
--- a/backend/plugin/db/driver.go
+++ b/backend/plugin/db/driver.go
@@ -334,6 +334,8 @@ type ConnectionConfig struct {
// SchemaTenantMode is the Oracle specific mode.
// If true, bytebase will treat the schema as a database.
SchemaTenantMode bool
+
+ ConnectionContext ConnectionContext
}
// SSHConfig is the configuration for connection over SSH.
@@ -399,7 +401,7 @@ type Driver interface {
// General execution
// A driver might support multiple engines (e.g. MySQL driver can support both MySQL and TiDB),
// So we pass the dbType to tell the exact engine.
- Open(ctx context.Context, dbType storepb.Engine, config ConnectionConfig, connCtx ConnectionContext) (Driver, error)
+ Open(ctx context.Context, dbType storepb.Engine, config ConnectionConfig) (Driver, error)
// Remember to call Close to avoid connection leak
Close(ctx context.Context) error
Ping(ctx context.Context) error
@@ -462,7 +464,7 @@ func Register(dbType storepb.Engine, f driverFunc) {
}
// Open opens a database specified by its database driver type and connection config without verifying the connection.
-func Open(ctx context.Context, dbType storepb.Engine, driverConfig DriverConfig, connectionConfig ConnectionConfig, connCtx ConnectionContext) (Driver, error) {
+func Open(ctx context.Context, dbType storepb.Engine, driverConfig DriverConfig, connectionConfig ConnectionConfig) (Driver, error) {
driversMu.RLock()
f, ok := drivers[dbType]
driversMu.RUnlock()
@@ -470,7 +472,7 @@ func Open(ctx context.Context, dbType storepb.Engine, driverConfig DriverConfig,
return nil, errors.Errorf("db: unknown driver %v", dbType)
}
- driver, err := f(driverConfig).Open(ctx, dbType, connectionConfig, connCtx)
+ driver, err := f(driverConfig).Open(ctx, dbType, connectionConfig)
if err != nil {
return nil, err
}
diff --git a/backend/plugin/db/mongodb/mongodb.go b/backend/plugin/db/mongodb/mongodb.go
index b92320b63e..1c165b53a8 100644
--- a/backend/plugin/db/mongodb/mongodb.go
+++ b/backend/plugin/db/mongodb/mongodb.go
@@ -49,7 +49,7 @@ func newDriver(dc db.DriverConfig) db.Driver {
}
// Open opens a MongoDB driver.
-func (driver *Driver) Open(ctx context.Context, _ storepb.Engine, connCfg db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(ctx context.Context, _ storepb.Engine, connCfg db.ConnectionConfig) (db.Driver, error) {
connectionURI := getMongoDBConnectionURI(connCfg)
opts := options.Client().ApplyURI(connectionURI)
client, err := mongo.Connect(ctx, opts)
@@ -57,7 +57,7 @@ func (driver *Driver) Open(ctx context.Context, _ storepb.Engine, connCfg db.Con
return nil, errors.Wrap(err, "failed to create MongoDB client")
}
driver.client = client
- driver.connectionCtx = connCtx
+ driver.connectionCtx = connCfg.ConnectionContext
driver.connCfg = connCfg
driver.databaseName = connCfg.Database
return driver, nil
diff --git a/backend/plugin/db/mssql/mssql.go b/backend/plugin/db/mssql/mssql.go
index 261aee0b8b..d32f851a1f 100644
--- a/backend/plugin/db/mssql/mssql.go
+++ b/backend/plugin/db/mssql/mssql.go
@@ -46,7 +46,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a MSSQL driver.
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, _ db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
query := url.Values{}
query.Add("app name", "Bytebase")
if config.Database != "" {
diff --git a/backend/plugin/db/mysql/mysql.go b/backend/plugin/db/mysql/mysql.go
index 90fe0eae06..822db41745 100644
--- a/backend/plugin/db/mysql/mysql.go
+++ b/backend/plugin/db/mysql/mysql.go
@@ -66,7 +66,7 @@ func newDriver(dc db.DriverConfig) db.Driver {
}
// Open opens a MySQL driver.
-func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, connCfg db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, connCfg db.ConnectionConfig) (db.Driver, error) {
protocol := "tcp"
if strings.HasPrefix(connCfg.Host, "/") {
protocol = "unix"
@@ -112,7 +112,7 @@ func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, connCfg db.
db.SetConnMaxLifetime(2 * time.Hour)
db.SetMaxOpenConns(50)
db.SetMaxIdleConns(15)
- driver.connectionCtx = connCtx
+ driver.connectionCtx = connCfg.ConnectionContext
driver.connCfg = connCfg
driver.databaseName = connCfg.Database
diff --git a/backend/plugin/db/obo/obo.go b/backend/plugin/db/obo/obo.go
index 3d48ac379c..e54d6fbe3b 100644
--- a/backend/plugin/db/obo/obo.go
+++ b/backend/plugin/db/obo/obo.go
@@ -37,7 +37,7 @@ func newDriver(db.DriverConfig) db.Driver {
return &Driver{}
}
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, _ db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
databaseName := func() string {
if config.Database != "" {
return config.Database
diff --git a/backend/plugin/db/oracle/oracle.go b/backend/plugin/db/oracle/oracle.go
index 8bc05eefcd..20fe1d38ce 100644
--- a/backend/plugin/db/oracle/oracle.go
+++ b/backend/plugin/db/oracle/oracle.go
@@ -49,7 +49,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a Oracle driver.
-func (driver *Driver) Open(ctx context.Context, _ storepb.Engine, config db.ConnectionConfig, connectionCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(ctx context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
port, err := strconv.Atoi(config.Port)
if err != nil {
return nil, errors.Errorf("invalid port %q", config.Port)
@@ -72,7 +72,7 @@ func (driver *Driver) Open(ctx context.Context, _ storepb.Engine, config db.Conn
driver.databaseName = config.Database
driver.serviceName = config.ServiceName
driver.schemaTenantMode = config.SchemaTenantMode
- driver.connectionCtx = connectionCtx
+ driver.connectionCtx = config.ConnectionContext
return driver, nil
}
diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
index 2519cbdeb5..9e45b3615e 100644
--- a/backend/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -63,7 +63,7 @@ func newDriver(config db.DriverConfig) db.Driver {
}
// Open opens a Postgres driver.
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, connectionCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
// Require username for Postgres, as the guessDSN 1st guess is to use the username as the connecting database
// if database name is not explicitly specified.
if config.Username == "" {
@@ -139,7 +139,7 @@ func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.Connec
return nil, err
}
driver.db = db
- driver.connectionCtx = connectionCtx
+ driver.connectionCtx = config.ConnectionContext
return driver, nil
}
diff --git a/backend/plugin/db/redis/redis.go b/backend/plugin/db/redis/redis.go
index 3f5c97da50..f4543c5e99 100644
--- a/backend/plugin/db/redis/redis.go
+++ b/backend/plugin/db/redis/redis.go
@@ -45,7 +45,7 @@ func newDriver(_ db.DriverConfig) db.Driver {
}
// Open opens the redis driver.
-func (d *Driver) Open(ctx context.Context, _ storepb.Engine, config db.ConnectionConfig, _ db.ConnectionContext) (db.Driver, error) {
+func (d *Driver) Open(ctx context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
addr := fmt.Sprintf("%s:%s", config.Host, config.Port)
tlsConfig, err := config.TLSConfig.GetSslConfig()
if err != nil {
diff --git a/backend/plugin/db/redshift/redshift.go b/backend/plugin/db/redshift/redshift.go
index e1d1077c6d..9328218a7c 100644
--- a/backend/plugin/db/redshift/redshift.go
+++ b/backend/plugin/db/redshift/redshift.go
@@ -65,7 +65,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a Postgres driver.
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, _ db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
// Require username for Postgres, as the guessDSN 1st guess is to use the username as the connecting database
// if database name is not explicitly specified.
if config.Username == "" {
diff --git a/backend/plugin/db/risingwave/risingwave.go b/backend/plugin/db/risingwave/risingwave.go
index fd03e51b6c..039366679b 100644
--- a/backend/plugin/db/risingwave/risingwave.go
+++ b/backend/plugin/db/risingwave/risingwave.go
@@ -61,7 +61,7 @@ func newDriver(config db.DriverConfig) db.Driver {
}
// Open opens a RisingWave driver.
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, _ db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
// Require username for Postgres, as the guessDSN 1st guess is to use the username as the connecting database
// if database name is not explicitly specified.
if config.Username == "" {
diff --git a/backend/plugin/db/snowflake/snowflake.go b/backend/plugin/db/snowflake/snowflake.go
index e48e818c5c..e34f766676 100644
--- a/backend/plugin/db/snowflake/snowflake.go
+++ b/backend/plugin/db/snowflake/snowflake.go
@@ -46,7 +46,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a Snowflake driver.
-func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
dsn, loggedDSN, err := buildSnowflakeDSN(config)
if err != nil {
return nil, err
@@ -54,8 +54,8 @@ func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.C
slog.Debug("Opening Snowflake driver",
slog.String("dsn", loggedDSN),
- slog.String("environment", connCtx.EnvironmentID),
- slog.String("database", connCtx.InstanceID),
+ slog.String("environment", config.ConnectionContext.EnvironmentID),
+ slog.String("database", config.ConnectionContext.InstanceID),
)
db, err := sql.Open("snowflake", dsn)
if err != nil {
@@ -63,7 +63,7 @@ func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, config db.C
}
driver.dbType = dbType
driver.db = db
- driver.connectionCtx = connCtx
+ driver.connectionCtx = config.ConnectionContext
driver.databaseName = config.Database
return driver, nil
diff --git a/backend/plugin/db/spanner/spanner.go b/backend/plugin/db/spanner/spanner.go
index f4b9695a4a..c754896e5e 100644
--- a/backend/plugin/db/spanner/spanner.go
+++ b/backend/plugin/db/spanner/spanner.go
@@ -56,12 +56,12 @@ func newDriver(_ db.DriverConfig) db.Driver {
// Open opens a Spanner driver. It must connect to a specific database.
// If database isn't provided, part of the driver cannot function.
-func (d *Driver) Open(ctx context.Context, _ storepb.Engine, config db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (d *Driver) Open(ctx context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
if config.Host == "" {
return nil, errors.New("host cannot be empty")
}
d.config = config
- d.connCtx = connCtx
+ d.connCtx = config.ConnectionContext
if config.Database != "" {
d.databaseName = d.config.Database
dsn := getDSN(d.config.Host, d.config.Database)
diff --git a/backend/plugin/db/sqlite/sqlite.go b/backend/plugin/db/sqlite/sqlite.go
index ef012a451b..d91a0e5145 100644
--- a/backend/plugin/db/sqlite/sqlite.go
+++ b/backend/plugin/db/sqlite/sqlite.go
@@ -46,7 +46,7 @@ func newDriver(db.DriverConfig) db.Driver {
}
// Open opens a SQLite driver.
-func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.ConnectionConfig) (db.Driver, error) {
// Host is the directory (instance) containing all SQLite databases.
driver.dir = config.Host
@@ -56,7 +56,7 @@ func (driver *Driver) Open(_ context.Context, _ storepb.Engine, config db.Connec
return nil, err
}
driver.db = db
- driver.connectionCtx = connCtx
+ driver.connectionCtx = config.ConnectionContext
driver.databaseName = config.Database
return driver, nil
}
diff --git a/backend/plugin/db/starrocks/starrocks.go b/backend/plugin/db/starrocks/starrocks.go
index cd04ad0777..d1fd4ba212 100644
--- a/backend/plugin/db/starrocks/starrocks.go
+++ b/backend/plugin/db/starrocks/starrocks.go
@@ -58,7 +58,7 @@ func newDriver(dc db.DriverConfig) db.Driver {
}
// Open opens a MySQL driver.
-func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, connCfg db.ConnectionConfig, connCtx db.ConnectionContext) (db.Driver, error) {
+func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, connCfg db.ConnectionConfig) (db.Driver, error) {
protocol := "tcp"
if strings.HasPrefix(connCfg.Host, "/") {
protocol = "unix"
@@ -104,7 +104,7 @@ func (driver *Driver) Open(_ context.Context, dbType storepb.Engine, connCfg db.
db.SetConnMaxLifetime(2 * time.Hour)
db.SetMaxOpenConns(50)
db.SetMaxIdleConns(15)
- driver.connectionCtx = connCtx
+ driver.connectionCtx = connCfg.ConnectionContext
driver.connCfg = connCfg
driver.databaseName = connCfg.Database
diff --git a/backend/resources/postgres/sample_instance.go b/backend/resources/postgres/sample_instance.go
index 24243b35a8..e85036ab82 100644
--- a/backend/resources/postgres/sample_instance.go
+++ b/backend/resources/postgres/sample_instance.go
@@ -170,7 +170,6 @@ func needSetupSampleDatabase(ctx context.Context, pgUser, port, database string)
Port: port,
Database: database,
},
- db.ConnectionContext{},
)
if err != nil {
return false, err
@@ -222,7 +221,6 @@ func prepareSampleDatabaseIfNeeded(ctx context.Context, pgUser, host, port, data
Port: port,
Database: database,
},
- db.ConnectionContext{},
)
if err != nil {
return errors.Wrapf(err, "failed to connect sample database")
@@ -248,7 +246,6 @@ func prepareSampleDatabase(ctx context.Context, pgUser, host, port, database str
Port: port,
Database: "postgres",
},
- db.ConnectionContext{},
)
if err != nil {
return errors.Wrapf(err, "failed to connect sample instance")
@@ -276,7 +273,6 @@ func createPGStatStatementsExtension(ctx context.Context, pgUser, host, port, da
Port: port,
Database: database,
},
- db.ConnectionContext{},
)
if err != nil {
return errors.Wrapf(err, "failed to connect sample database")
@@ -302,7 +298,6 @@ func dropDefaultPostgresDatabase(ctx context.Context, pgUser, host, port, connec
Port: port,
Database: connectingDb,
},
- db.ConnectionContext{},
)
if err != nil {
return errors.Wrapf(err, "failed to connect sample instance")
diff --git a/backend/store/pg_engine.go b/backend/store/pg_engine.go
index 75a16251ed..8d339e0376 100644
--- a/backend/store/pg_engine.go
+++ b/backend/store/pg_engine.go
@@ -57,7 +57,6 @@ func (db *DB) Open(ctx context.Context, createDB bool) error {
storepb.Engine_POSTGRES,
dbdriver.DriverConfig{DbBinDir: db.binDir},
createCfg,
- dbdriver.ConnectionContext{},
)
if err != nil {
return err
@@ -74,7 +73,6 @@ func (db *DB) Open(ctx context.Context, createDB bool) error {
storepb.Engine_POSTGRES,
dbdriver.DriverConfig{DbBinDir: db.binDir},
db.ConnCfg,
- dbdriver.ConnectionContext{},
)
if err != nil {
return err
diff --git a/backend/tests/grouping_change_test.go b/backend/tests/grouping_change_test.go
index 9404e26e33..bfeb83d800 100644
--- a/backend/tests/grouping_change_test.go
+++ b/backend/tests/grouping_change_test.go
@@ -408,7 +408,7 @@ func TestCreateTableGroup(t *testing.T) {
dbDriver, err := db.Open(ctx, storepb.Engine_SQLITE, db.DriverConfig{}, db.ConnectionConfig{
Host: instanceDir,
Database: preCreateDatabase,
- }, db.ConnectionContext{})
+ })
a.NoError(err)
for _, preCreateTable := range prepareInstance.matchDatabasesNameTableName[preCreateDatabase].matched {