@prisma/adapter-pg 7.11.0-dev.7 → 7.11.0-dev.9

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.
package/dist/index.js CHANGED
@@ -303,14 +303,17 @@ function normalize_array(element_normalizer) {
303
303
  function normalize_numeric(numeric) {
304
304
  return numeric;
305
305
  }
306
+ function expandYear(value) {
307
+ return value.replace(/^(\d{5,})(?=-)/, (_, year) => `+${year.padStart(6, "0")}`);
308
+ }
306
309
  function normalize_date(date) {
307
- return date;
310
+ return expandYear(date);
308
311
  }
309
312
  function normalize_timestamp(time) {
310
- return `${time.replace(" ", "T")}+00:00`;
313
+ return expandYear(`${time.replace(" ", "T")}+00:00`);
311
314
  }
312
315
  function normalize_timestamptz(time) {
313
- return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
316
+ return expandYear(time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00"));
314
317
  }
315
318
  function normalize_time(time) {
316
319
  return time;
package/dist/index.mjs CHANGED
@@ -267,14 +267,17 @@ function normalize_array(element_normalizer) {
267
267
  function normalize_numeric(numeric) {
268
268
  return numeric;
269
269
  }
270
+ function expandYear(value) {
271
+ return value.replace(/^(\d{5,})(?=-)/, (_, year) => `+${year.padStart(6, "0")}`);
272
+ }
270
273
  function normalize_date(date) {
271
- return date;
274
+ return expandYear(date);
272
275
  }
273
276
  function normalize_timestamp(time) {
274
- return `${time.replace(" ", "T")}+00:00`;
277
+ return expandYear(`${time.replace(" ", "T")}+00:00`);
275
278
  }
276
279
  function normalize_timestamptz(time) {
277
- return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
280
+ return expandYear(time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00"));
278
281
  }
279
282
  function normalize_time(time) {
280
283
  return time;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-pg",
3
- "version": "7.11.0-dev.7",
3
+ "version": "7.11.0-dev.9",
4
4
  "description": "Prisma's driver adapter for \"pg\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,10 +34,10 @@
34
34
  "pg": "^8.16.3",
35
35
  "postgres-array": "3.0.4",
36
36
  "@types/pg": "^8.16.0",
37
- "@prisma/driver-adapter-utils": "7.11.0-dev.7"
37
+ "@prisma/driver-adapter-utils": "7.11.0-dev.9"
38
38
  },
39
39
  "devDependencies": {
40
- "@prisma/debug": "7.11.0-dev.7"
40
+ "@prisma/debug": "7.11.0-dev.9"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "DEV=true tsx helpers/build.ts",