@teamkeel/functions-runtime 0.396.7 → 0.396.8-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/database.js +12 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamkeel/functions-runtime",
3
- "version": "0.396.7",
3
+ "version": "0.396.8-next.2",
4
4
  "description": "Internal package used by @teamkeel/sdk",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/database.js CHANGED
@@ -140,15 +140,15 @@ class InstrumentedClient extends pg.Client {
140
140
  }
141
141
 
142
142
  function getDialect() {
143
- // Adding a custom type parser for numeric fields: see https://kysely.dev/docs/recipes/data-types#configuring-runtime-javascript-types
144
- // 1700 = type for NUMERIC
145
- pg.types.setTypeParser(1700, function (val) {
146
- return parseFloat(val);
147
- });
148
-
149
143
  const dbConnType = process.env["KEEL_DB_CONN_TYPE"];
150
144
  switch (dbConnType) {
151
145
  case "pg":
146
+ // Adding a custom type parser for numeric fields: see https://kysely.dev/docs/recipes/data-types#configuring-runtime-javascript-types
147
+ // 1700 = type for NUMERIC
148
+ pg.types.setTypeParser(1700, function (val) {
149
+ return parseFloat(val);
150
+ });
151
+
152
152
  return new PostgresDialect({
153
153
  pool: new InstrumentedPool({
154
154
  Client: InstrumentedClient,
@@ -169,6 +169,12 @@ function getDialect() {
169
169
  }),
170
170
  });
171
171
  case "neon":
172
+ // Adding a custom type parser for numeric fields: see https://kysely.dev/docs/recipes/data-types#configuring-runtime-javascript-types
173
+ // 1700 = type for NUMERIC
174
+ neonserverless.types.setTypeParser(1700, function (val) {
175
+ return parseFloat(val);
176
+ });
177
+
172
178
  neonserverless.neonConfig.webSocketConstructor = ws;
173
179
 
174
180
  const pool = new InstrumentedNeonServerlessPool({