@prisma/adapter-pg 6.15.0-dev.6 → 6.15.0-dev.8
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 +18 -2
- package/dist/index.mjs +18 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -372,9 +372,11 @@ function mapArg(arg, argType) {
|
|
|
372
372
|
switch (argType.dbType) {
|
|
373
373
|
case "TIME":
|
|
374
374
|
case "TIMETZ":
|
|
375
|
-
return arg
|
|
375
|
+
return formatTime(arg);
|
|
376
|
+
case "DATE":
|
|
377
|
+
return formatDate(arg);
|
|
376
378
|
default:
|
|
377
|
-
return arg
|
|
379
|
+
return formatDateTime(arg);
|
|
378
380
|
}
|
|
379
381
|
}
|
|
380
382
|
if (typeof arg === "string" && argType.scalarType === "bytes") {
|
|
@@ -388,6 +390,20 @@ function mapArg(arg, argType) {
|
|
|
388
390
|
}
|
|
389
391
|
return arg;
|
|
390
392
|
}
|
|
393
|
+
function formatDateTime(date) {
|
|
394
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
395
|
+
const ms = date.getUTCMilliseconds();
|
|
396
|
+
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") : "");
|
|
397
|
+
}
|
|
398
|
+
function formatDate(date) {
|
|
399
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
400
|
+
return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
|
|
401
|
+
}
|
|
402
|
+
function formatTime(date) {
|
|
403
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
404
|
+
const ms = date.getUTCMilliseconds();
|
|
405
|
+
return pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
|
|
406
|
+
}
|
|
391
407
|
|
|
392
408
|
// src/errors.ts
|
|
393
409
|
var TLS_ERRORS = /* @__PURE__ */ new Set([
|
package/dist/index.mjs
CHANGED
|
@@ -336,9 +336,11 @@ function mapArg(arg, argType) {
|
|
|
336
336
|
switch (argType.dbType) {
|
|
337
337
|
case "TIME":
|
|
338
338
|
case "TIMETZ":
|
|
339
|
-
return arg
|
|
339
|
+
return formatTime(arg);
|
|
340
|
+
case "DATE":
|
|
341
|
+
return formatDate(arg);
|
|
340
342
|
default:
|
|
341
|
-
return arg
|
|
343
|
+
return formatDateTime(arg);
|
|
342
344
|
}
|
|
343
345
|
}
|
|
344
346
|
if (typeof arg === "string" && argType.scalarType === "bytes") {
|
|
@@ -352,6 +354,20 @@ function mapArg(arg, argType) {
|
|
|
352
354
|
}
|
|
353
355
|
return arg;
|
|
354
356
|
}
|
|
357
|
+
function formatDateTime(date) {
|
|
358
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
359
|
+
const ms = date.getUTCMilliseconds();
|
|
360
|
+
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") : "");
|
|
361
|
+
}
|
|
362
|
+
function formatDate(date) {
|
|
363
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
364
|
+
return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate());
|
|
365
|
+
}
|
|
366
|
+
function formatTime(date) {
|
|
367
|
+
const pad = (n, z = 2) => String(n).padStart(z, "0");
|
|
368
|
+
const ms = date.getUTCMilliseconds();
|
|
369
|
+
return pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + (ms ? "." + String(ms).padStart(3, "0") : "");
|
|
370
|
+
}
|
|
355
371
|
|
|
356
372
|
// src/errors.ts
|
|
357
373
|
var TLS_ERRORS = /* @__PURE__ */ new Set([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-pg",
|
|
3
|
-
"version": "6.15.0-dev.
|
|
3
|
+
"version": "6.15.0-dev.8",
|
|
4
4
|
"description": "Prisma's driver adapter for \"pg\"",
|
|
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
|
"pg": "^8.11.3",
|
|
36
|
-
"@prisma/driver-adapter-utils": "6.15.0-dev.
|
|
36
|
+
"@prisma/driver-adapter-utils": "6.15.0-dev.8"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@swc/core": "1.11.5",
|