Skip to content

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

fix: SqlService Query read only accordingly (#14547)

p0nyd9ef9698a773
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index cdf068b46a..c988852fc4 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -189,7 +189,7 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
if err != nil {
return nil, err
}
- driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.DataShare, true /* readOnly */, db.ConnectionContext{})
+ driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.DataShare, dataSource.Type == api.RO /* readOnly */, db.ConnectionContext{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get database driver: %v", err)
}