diff --git a/sources/generic/sql-source-proxy/sourceProxy.js b/sources/generic/sql-source-proxy/sourceProxy.js index 09b5f4fb..1ae72ea3 100644 --- a/sources/generic/sql-source-proxy/sourceProxy.js +++ b/sources/generic/sql-source-proxy/sourceProxy.js @@ -12,6 +12,16 @@ const sourceId = process.env["SOURCE_ID"]; const inspector = schemaInspector.SchemaInspector(knex); +const pgTypes = require('pg').types; + +const parseBigInt = (value) => Number(value); +const parseNumeric = (value) => Number(value); +const parseMoney = (value) => Number(value.replace(/^\$/, '')); +pgTypes.setTypeParser(20, parseBigInt); +pgTypes.setTypeParser(1700, parseNumeric); +pgTypes.setTypeParser(790, parseMoney); + + async function main() { const app = express(); app.use(cors());