Skip to content

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

Specify RETURNING columns explicitly, otherwise adding a new column would break the code

天舟9c65cab3c403
diff --git a/backend/store/member.go b/backend/store/member.go
index d169b7bd0c..78cb28e240 100644
--- a/backend/store/member.go
+++ b/backend/store/member.go
@@ -232,7 +232,7 @@ func patchMember(ctx context.Context, tx *Tx, id int, patch *api.MemberPatch) (*
UPDATE member
SET role = ?, updater_id = ?
WHERE id = ?
- RETURNING *
+ RETURNING id, workspace_id, creator_id, created_ts, updater_id, updated_ts, role, principal_id
`,
member.Role,
patch.UpdaterId,
diff --git a/backend/store/principal.go b/backend/store/principal.go
index fd71d3dadd..f3dc059756 100644
--- a/backend/store/principal.go
+++ b/backend/store/principal.go
@@ -124,7 +124,7 @@ func createPrincipal(ctx context.Context, tx *Tx, create *api.PrincipalCreate) (
password_hash
)
VALUES (?, ?, ?, ?, ?, ?, ?)
- RETURNING *
+ RETURNING id, creator_id, created_ts, updater_id, updated_ts, status, type, name, email, password_hash
`,
create.CreatorId,
create.CreatorId,
@@ -251,7 +251,7 @@ func patchPrincipal(ctx context.Context, tx *Tx, id int, patch *api.PrincipalPat
UPDATE principal
SET name = ?, updater_id = ?
WHERE id = ?
- RETURNING *
+ RETURNING id, creator_id, created_ts, updater_id, updated_ts, status, type, name, email, password_hash
`,
principal.Name,
patch.UpdaterId,