MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / handle

Method handle

packages/plugins/soft-delete/src/plugin.ts:68–79  ·  view source on GitHub ↗
(node: RootOperationNode, proceed: ProceedKyselyQueryFunction)

Source from the content-addressed store, hash-verified

66 }
67
68 async handle(node: RootOperationNode, proceed: ProceedKyselyQueryFunction) {
69 if (DeleteQueryNode.is(node)) {
70 const converted = this.tryConvertDeleteToUpdate(node);
71 if (converted) {
72 // The rewritten UPDATE still flows through `transformUpdateQuery` so the
73 // soft-delete filter is added and already-soft-deleted rows aren't re-touched.
74 return proceed(this.transformNode(converted));
75 }
76 // Not a soft-delete target: let the delete (and any DB-level cascade) proceed naturally.
77 }
78 return proceed(this.transformNode(node));
79 }
80
81 // Inject `<deletedAt> IS NULL` for soft-delete tables in the FROM clause.
82 protected override transformSelectQuery(node: SelectQueryNode): SelectQueryNode {

Callers 1

onKyselyQueryMethod · 0.95

Calls 2

proceedFunction · 0.85

Tested by

no test coverage detected