Skip to content

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

fix: use admin driver for sync schema (#3517)

Danny Xu8f0885c00e0d
diff --git a/server/sql.go b/server/sql.go
index a07ecd967e..9d9a85ed63 100644
--- a/server/sql.go
+++ b/server/sql.go
@@ -490,7 +490,7 @@ func (s *Server) registerSQLRoutes(g *echo.Group) {
}
func (s *Server) syncInstance(ctx context.Context, instance *api.Instance) ([]string, error) {
- driver, err := tryGetReadOnlyDatabaseDriver(ctx, instance, "")
+ driver, err := getAdminDatabaseDriver(ctx, instance, "", s.pgInstance.BaseDir, s.profile.DataDir)
if err != nil {
return nil, err
}
@@ -647,7 +647,7 @@ func (s *Server) syncInstanceSchema(ctx context.Context, instance *api.Instance,
}
func (s *Server) syncDatabaseSchema(ctx context.Context, instance *api.Instance, databaseName string) error {
- driver, err := tryGetReadOnlyDatabaseDriver(ctx, instance, "")
+ driver, err := getAdminDatabaseDriver(ctx, instance, "", s.pgInstance.BaseDir, s.profile.DataDir)
if err != nil {
return err
}