From bef458dbf81acfbb60ecb36877c9bba31c3f343b Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 13 Jul 2026 12:41:11 +0200 Subject: [PATCH] =?UTF-8?q?Rename=20executeRaw=20=E2=86=92=20executeRawUns?= =?UTF-8?q?afe=20to=20make=20SQL=20injection=20risk=20explicit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method wraps Prisma's which trusts the caller to use ? placeholders. The Unsafe suffix is a naming convention that signals 'review caller for parameterization'. --- src/lib/foundation/database.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/foundation/database.ts b/src/lib/foundation/database.ts index e71a701d..6bb85009 100644 --- a/src/lib/foundation/database.ts +++ b/src/lib/foundation/database.ts @@ -105,7 +105,12 @@ export class DbService { } } - async executeRaw(query: string, ...values: unknown[]): Promise { + /** + * Execute a raw SQL string with parameterized ? placeholders. + * Named "Unsafe" because the caller is responsible for using ? placeholders + * and never interpolating user input directly into the query string. + */ + async executeRawUnsafe(query: string, ...values: unknown[]): Promise { try { return await this.client.$executeRawUnsafe(query, ...values); } catch (cause) {