Merge branch 'main' of ssh://gitea.meghsakha.com:22222/Benjamin_Boenisch/breakpilot-core
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m9s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 32s
CI / test-python-voice (push) Successful in 37s
CI / test-bqas (push) Successful in 36s

This commit is contained in:
Benjamin Admin
2026-04-15 22:26:57 +02:00

View File

@@ -1,4 +1,11 @@
import { Pool } from 'pg' import { Pool, types } from 'pg'
// Coerce NUMERIC/DECIMAL columns to JS numbers globally. The default
// node-postgres behavior hands them back as strings, which silently breaks
// every downstream `.toFixed()` / direct-number call (seen crashing
// UnitEconomicsCards on the Finanzen slide). Our values fit comfortably in
// Number.MAX_SAFE_INTEGER, so the precision trade-off is fine.
types.setTypeParser(types.builtins.NUMERIC, (val) => (val === null ? null : parseFloat(val)))
const pool = new Pool({ const pool = new Pool({
connectionString: process.env.DATABASE_URL || 'postgres://breakpilot:breakpilot123@localhost:5432/breakpilot_db', connectionString: process.env.DATABASE_URL || 'postgres://breakpilot:breakpilot123@localhost:5432/breakpilot_db',