feat(bases): allow updateRow to set position atomically

This commit is contained in:
Philipinho
2026-05-24 12:31:36 +01:00
parent a793e65560
commit 9cec9b64c6
5 changed files with 21 additions and 0 deletions
@@ -275,6 +275,7 @@ export class BaseRowRepo {
pageId: string;
workspaceId: string;
actorId?: string;
position?: string;
trx?: KyselyTransaction;
},
): Promise<BaseRow | undefined> {
@@ -287,6 +288,7 @@ export class BaseRowRepo {
.updateTable('baseRows')
.set({
cells: sql`jsonb_set_many(cells, ${patchJson}::text::jsonb)`,
...(opts.position !== undefined && { position: opts.position }),
updatedAt: new Date(),
lastUpdatedById: opts.actorId ?? null,
})