From e819c5739e59ac8b2b1a2b424e799b96f55cb250 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Tue, 18 Aug 2026 19:26:07 +0530 Subject: [PATCH] Revert "chore(example): regenerate basic-app queries" The generator's placeholder style is not deterministic across runs: the same command emitted $1 once and ? the next time, depending on the database dialect active in the environment. Restoring the committed output and reverting my earlier regeneration, which was environment churn rather than an intended change. Worth a look on its own: a generator whose output depends on ambient environment makes check:generated-types environment-sensitive. Co-Authored-By: Claude Opus 5 --- examples/basic-app/app/db/queries.gen.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/basic-app/app/db/queries.gen.ts b/examples/basic-app/app/db/queries.gen.ts index 0d83d4b3..da6ca380 100644 --- a/examples/basic-app/app/db/queries.gen.ts +++ b/examples/basic-app/app/db/queries.gen.ts @@ -3,7 +3,7 @@ import type { Db, ExecResult } from "@wrnexus/db"; import { users } from "./schema.ts"; export async function GetUserByEmail(db: Db, args: { email: string }): Promise<{ id: number; email: string; name: string; active: boolean; passwordHash: string; createdAt: Date } | null> { - return (await db.one("SELECT * FROM users WHERE email = $1", [args.email], users)) as { id: number; email: string; name: string; active: boolean; passwordHash: string; createdAt: Date } | null; + return (await db.one("SELECT * FROM users WHERE email = ?", [args.email], users)) as { id: number; email: string; name: string; active: boolean; passwordHash: string; createdAt: Date } | null; } export async function ListUsers(db: Db): Promise<{ id: number; name: string; active: boolean }[]> { @@ -11,13 +11,13 @@ export async function ListUsers(db: Db): Promise<{ id: number; name: string; act } export async function CountActive(db: Db, args: { active: boolean }): Promise<{ n: number } | null> { - return (await db.one("SELECT COUNT(*) AS n FROM users WHERE active = $1", [args.active])) as { n: number } | null; + return (await db.one("SELECT COUNT(*) AS n FROM users WHERE active = ?", [args.active])) as { n: number } | null; } export async function CreateUser(db: Db, args: { email: string; name: string; active: boolean }): Promise { - return db.exec("INSERT INTO users (email, name, active) VALUES ($1, $2, $3)", [args.email, args.name, args.active]); + return db.exec("INSERT INTO users (email, name, active) VALUES (?, ?, ?)", [args.email, args.name, args.active]); } export async function DeactivateUser(db: Db, args: { id: number }): Promise { - return db.exec("UPDATE users SET active = 0 WHERE id = $1", [args.id]); + return db.exec("UPDATE users SET active = 0 WHERE id = ?", [args.id]); }