[object Object]

← back to Schumacher Internal

TK-11438: migrate build script postgres connections to unix socket

517549c767203b1d5031138b90a947b15de184d7 · 2026-09-15 04:08:03 -0700 · steve@designerwallcoverings.com

Files touched

Diff

commit 517549c767203b1d5031138b90a947b15de184d7
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date:   Tue Sep 15 04:08:03 2026 -0700

    TK-11438: migrate build script postgres connections to unix socket
---
 scripts/build-products-json.js | 2 +-
 scripts/scrape-astek.js        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/build-products-json.js b/scripts/build-products-json.js
index d260a5f..ce49558 100644
--- a/scripts/build-products-json.js
+++ b/scripts/build-products-json.js
@@ -22,7 +22,7 @@ const PW = (() => {
   const m = env.match(/^DW_ADMIN_DB_PASSWORD=(.*)$/m);
   return m ? m[1].replace(/^["']|["']$/g, '').trim() : (process.env.PGPASSWORD || '');
 })();
-const pool = new Pool({ host: '127.0.0.1', port: 5432, user: 'dw_admin', database: 'dw_unified', password: PW });
+const pool = new Pool({ host: process.env.PGHOST || (process.platform === 'darwin' ? '/tmp' : '127.0.0.1'), port: 5432, user: 'dw_admin', database: 'dw_unified', password: PW });
 
 const BUCKET = {
   white: 'white', ivory: 'white', cream: 'white', beige: 'white', alabaster: 'white', oatmeal: 'white',
diff --git a/scripts/scrape-astek.js b/scripts/scrape-astek.js
index 42d5d69..b590e32 100644
--- a/scripts/scrape-astek.js
+++ b/scripts/scrape-astek.js
@@ -26,7 +26,7 @@ const PW = (() => {
 })();
 
 const pool = new Pool({
-  host: '127.0.0.1', port: 5432, user: 'dw_admin', database: 'dw_unified', password: PW,
+  host: process.env.PGHOST || (process.platform === 'darwin' ? '/tmp' : '127.0.0.1'), port: 5432, user: 'dw_admin', database: 'dw_unified', password: PW,
 });
 
 const BANNED = s => (s || '')

← b1db05a TK-11438: migrate postgres pool to unix socket (darwin fallb  ·  back to Schumacher Internal  ·  (newest)