From 1d082d901663c151638837fef5807eae893348c6 Mon Sep 17 00:00:00 2001 From: OpenClaw Agent Date: Fri, 13 Mar 2026 15:13:32 +0000 Subject: [PATCH] fix: split initDb into two queries (pg no multi-command prepared stmts) --- server.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index 93b01cc..cc4b8b9 100644 --- a/server.js +++ b/server.js @@ -31,10 +31,12 @@ async function initDb() { id INT PRIMARY KEY DEFAULT 1, content TEXT NOT NULL DEFAULT '', updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() - ); - INSERT INTO card_text (id, content) VALUES (1, $1) - ON CONFLICT (id) DO NOTHING; - `, [DEFAULT_TEXT]); + ) + `); + await pool.query( + `INSERT INTO card_text (id, content) VALUES (1, $1) ON CONFLICT (id) DO NOTHING`, + [DEFAULT_TEXT] + ); } // ── CORS ──────────────────────────────────────────────────────────────────