@prisma/adapter-neon 6.18.0-dev.18 → 6.18.0-dev.19

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
@@ -68,6 +68,7 @@ var ArrayColumnType = {
68
68
  OID_ARRAY: 1028,
69
69
  TEXT_ARRAY: 1009,
70
70
  TIMESTAMP_ARRAY: 1115,
71
+ TIMESTAMPTZ_ARRAY: 1185,
71
72
  TIME_ARRAY: 1183,
72
73
  UUID_ARRAY: 2951,
73
74
  VARBIT_ARRAY: 1563,
@@ -295,10 +296,10 @@ function normalize_date(date) {
295
296
  return date;
296
297
  }
297
298
  function normalize_timestamp(time) {
298
- return (/* @__PURE__ */ new Date(`${time}Z`)).toISOString().replace(/(\.000)?Z$/, "+00:00");
299
+ return `${time.replace(" ", "T")}+00:00`;
299
300
  }
300
- function normalize_timestampz(time) {
301
- return new Date(time.replace(/[+-]\d{2}(:\d{2})?$/, "Z")).toISOString().replace(/(\.000)?Z$/, "+00:00");
301
+ function normalize_timestamptz(time) {
302
+ return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
302
303
  }
303
304
  function normalize_time(time) {
304
305
  return time;
@@ -341,7 +342,8 @@ var customParsers = {
341
342
  [ArrayColumnType.DATE_ARRAY]: normalize_array(normalize_date),
342
343
  [ScalarColumnType.TIMESTAMP]: normalize_timestamp,
343
344
  [ArrayColumnType.TIMESTAMP_ARRAY]: normalize_array(normalize_timestamp),
344
- [ScalarColumnType.TIMESTAMPTZ]: normalize_timestampz,
345
+ [ScalarColumnType.TIMESTAMPTZ]: normalize_timestamptz,
346
+ [ArrayColumnType.TIMESTAMPTZ_ARRAY]: normalize_array(normalize_timestamptz),
345
347
  [ScalarColumnType.MONEY]: normalize_money,
346
348
  [ArrayColumnType.MONEY_ARRAY]: normalize_array(normalize_money),
347
349
  [ScalarColumnType.JSON]: toJson,
@@ -389,11 +391,11 @@ function mapArg(arg, argType) {
389
391
  function formatDateTime(date) {
390
392
  const pad = (n, z = 2) => String(n).padStart(z, "0");
391
393
  const ms = date.getUTCMilliseconds();
392
- return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + " " + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
394
+ return pad(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + " " + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
393
395
  }
394
396
  function formatDate(date) {
395
397
  const pad = (n, z = 2) => String(n).padStart(z, "0");
396
- return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
398
+ return pad(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
397
399
  }
398
400
  function formatTime(date) {
399
401
  const pad = (n, z = 2) => String(n).padStart(z, "0");
package/dist/index.mjs CHANGED
@@ -31,6 +31,7 @@ var ArrayColumnType = {
31
31
  OID_ARRAY: 1028,
32
32
  TEXT_ARRAY: 1009,
33
33
  TIMESTAMP_ARRAY: 1115,
34
+ TIMESTAMPTZ_ARRAY: 1185,
34
35
  TIME_ARRAY: 1183,
35
36
  UUID_ARRAY: 2951,
36
37
  VARBIT_ARRAY: 1563,
@@ -258,10 +259,10 @@ function normalize_date(date) {
258
259
  return date;
259
260
  }
260
261
  function normalize_timestamp(time) {
261
- return (/* @__PURE__ */ new Date(`${time}Z`)).toISOString().replace(/(\.000)?Z$/, "+00:00");
262
+ return `${time.replace(" ", "T")}+00:00`;
262
263
  }
263
- function normalize_timestampz(time) {
264
- return new Date(time.replace(/[+-]\d{2}(:\d{2})?$/, "Z")).toISOString().replace(/(\.000)?Z$/, "+00:00");
264
+ function normalize_timestamptz(time) {
265
+ return time.replace(" ", "T").replace(/[+-]\d{2}(:\d{2})?$/, "+00:00");
265
266
  }
266
267
  function normalize_time(time) {
267
268
  return time;
@@ -304,7 +305,8 @@ var customParsers = {
304
305
  [ArrayColumnType.DATE_ARRAY]: normalize_array(normalize_date),
305
306
  [ScalarColumnType.TIMESTAMP]: normalize_timestamp,
306
307
  [ArrayColumnType.TIMESTAMP_ARRAY]: normalize_array(normalize_timestamp),
307
- [ScalarColumnType.TIMESTAMPTZ]: normalize_timestampz,
308
+ [ScalarColumnType.TIMESTAMPTZ]: normalize_timestamptz,
309
+ [ArrayColumnType.TIMESTAMPTZ_ARRAY]: normalize_array(normalize_timestamptz),
308
310
  [ScalarColumnType.MONEY]: normalize_money,
309
311
  [ArrayColumnType.MONEY_ARRAY]: normalize_array(normalize_money),
310
312
  [ScalarColumnType.JSON]: toJson,
@@ -352,11 +354,11 @@ function mapArg(arg, argType) {
352
354
  function formatDateTime(date) {
353
355
  const pad = (n, z = 2) => String(n).padStart(z, "0");
354
356
  const ms = date.getUTCMilliseconds();
355
- return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + " " + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
357
+ return pad(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + " " + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
356
358
  }
357
359
  function formatDate(date) {
358
360
  const pad = (n, z = 2) => String(n).padStart(z, "0");
359
- return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
361
+ return pad(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
360
362
  }
361
363
  function formatTime(date) {
362
364
  const pad = (n, z = 2) => String(n).padStart(z, "0");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-neon",
3
- "version": "6.18.0-dev.18",
3
+ "version": "6.18.0-dev.19",
4
4
  "description": "Prisma's driver adapter for \"@neondatabase/serverless\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,10 +33,10 @@
33
33
  "dependencies": {
34
34
  "postgres-array": "3.0.4",
35
35
  "@neondatabase/serverless": ">0.6.0 <2",
36
- "@prisma/driver-adapter-utils": "6.18.0-dev.18"
36
+ "@prisma/driver-adapter-utils": "6.18.0-dev.19"
37
37
  },
38
38
  "devDependencies": {
39
- "@prisma/debug": "6.18.0-dev.18"
39
+ "@prisma/debug": "6.18.0-dev.19"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "DEV=true tsx helpers/build.ts",