@prisma/adapter-neon 6.15.0-dev.7 → 6.15.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
@@ -368,9 +368,11 @@ function mapArg(arg, argType) {
368
368
  switch (argType.dbType) {
369
369
  case "TIME":
370
370
  case "TIMETZ":
371
- return arg.toISOString().split("T")[1];
371
+ return formatTime(arg);
372
+ case "DATE":
373
+ return formatDate(arg);
372
374
  default:
373
- return arg.toISOString();
375
+ return formatDateTime(arg);
374
376
  }
375
377
  }
376
378
  if (typeof arg === "string" && argType.scalarType === "bytes") {
@@ -384,6 +386,20 @@ function mapArg(arg, argType) {
384
386
  }
385
387
  return arg;
386
388
  }
389
+ function formatDateTime(date) {
390
+ const pad = (n, z = 2) => String(n).padStart(z, "0");
391
+ 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") : "");
393
+ }
394
+ function formatDate(date) {
395
+ const pad = (n, z = 2) => String(n).padStart(z, "0");
396
+ return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
397
+ }
398
+ function formatTime(date) {
399
+ const pad = (n, z = 2) => String(n).padStart(z, "0");
400
+ const ms = date.getUTCMilliseconds();
401
+ return pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
402
+ }
387
403
 
388
404
  // src/errors.ts
389
405
  function convertDriverError(error) {
package/dist/index.mjs CHANGED
@@ -331,9 +331,11 @@ function mapArg(arg, argType) {
331
331
  switch (argType.dbType) {
332
332
  case "TIME":
333
333
  case "TIMETZ":
334
- return arg.toISOString().split("T")[1];
334
+ return formatTime(arg);
335
+ case "DATE":
336
+ return formatDate(arg);
335
337
  default:
336
- return arg.toISOString();
338
+ return formatDateTime(arg);
337
339
  }
338
340
  }
339
341
  if (typeof arg === "string" && argType.scalarType === "bytes") {
@@ -347,6 +349,20 @@ function mapArg(arg, argType) {
347
349
  }
348
350
  return arg;
349
351
  }
352
+ function formatDateTime(date) {
353
+ const pad = (n, z = 2) => String(n).padStart(z, "0");
354
+ 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") : "");
356
+ }
357
+ function formatDate(date) {
358
+ const pad = (n, z = 2) => String(n).padStart(z, "0");
359
+ return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
360
+ }
361
+ function formatTime(date) {
362
+ const pad = (n, z = 2) => String(n).padStart(z, "0");
363
+ const ms = date.getUTCMilliseconds();
364
+ return pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
365
+ }
350
366
 
351
367
  // src/errors.ts
352
368
  function convertDriverError(error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-neon",
3
- "version": "6.15.0-dev.7",
3
+ "version": "6.15.0-dev.9",
4
4
  "description": "Prisma's driver adapter for \"@neondatabase/serverless\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "postgres-array": "3.0.4",
35
35
  "@neondatabase/serverless": ">0.6.0 <2",
36
- "@prisma/driver-adapter-utils": "6.15.0-dev.7"
36
+ "@prisma/driver-adapter-utils": "6.15.0-dev.9"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@swc/core": "1.11.5",