@prisma/adapter-pg-worker
Advanced tools
Comparing version 5.11.0-dev.45 to 5.11.0-dev.46
@@ -45,4 +45,4 @@ "use strict"; | ||
var import_postgres_array = require("postgres-array"); | ||
var types2 = pg.types; | ||
var ScalarColumnType = types2.builtins; | ||
var { types } = pg; | ||
var { builtins: ScalarColumnType, getTypeParser, setTypeParser } = types; | ||
var ArrayColumnType = { | ||
@@ -292,4 +292,4 @@ BIT_ARRAY: 1561, | ||
} | ||
types2.setTypeParser(ScalarColumnType.NUMERIC, normalize_numeric); | ||
types2.setTypeParser(ArrayColumnType.NUMERIC_ARRAY, normalize_array(normalize_numeric)); | ||
setTypeParser(ScalarColumnType.NUMERIC, normalize_numeric); | ||
setTypeParser(ArrayColumnType.NUMERIC_ARRAY, normalize_array(normalize_numeric)); | ||
function normalize_date(date) { | ||
@@ -310,24 +310,24 @@ return date; | ||
} | ||
types2.setTypeParser(ScalarColumnType.TIME, normalize_time); | ||
types2.setTypeParser(ArrayColumnType.TIME_ARRAY, normalize_array(normalize_time)); | ||
types2.setTypeParser(ScalarColumnType.TIMETZ, normalize_timez); | ||
types2.setTypeParser(ScalarColumnType.DATE, normalize_date); | ||
types2.setTypeParser(ArrayColumnType.DATE_ARRAY, normalize_array(normalize_date)); | ||
types2.setTypeParser(ScalarColumnType.TIMESTAMP, normalize_timestamp); | ||
types2.setTypeParser(ArrayColumnType.TIMESTAMP_ARRAY, normalize_array(normalize_timestamp)); | ||
types2.setTypeParser(ScalarColumnType.TIMESTAMPTZ, normalize_timestampz); | ||
setTypeParser(ScalarColumnType.TIME, normalize_time); | ||
setTypeParser(ArrayColumnType.TIME_ARRAY, normalize_array(normalize_time)); | ||
setTypeParser(ScalarColumnType.TIMETZ, normalize_timez); | ||
setTypeParser(ScalarColumnType.DATE, normalize_date); | ||
setTypeParser(ArrayColumnType.DATE_ARRAY, normalize_array(normalize_date)); | ||
setTypeParser(ScalarColumnType.TIMESTAMP, normalize_timestamp); | ||
setTypeParser(ArrayColumnType.TIMESTAMP_ARRAY, normalize_array(normalize_timestamp)); | ||
setTypeParser(ScalarColumnType.TIMESTAMPTZ, normalize_timestampz); | ||
function normalize_money(money) { | ||
return money.slice(1); | ||
} | ||
types2.setTypeParser(ScalarColumnType.MONEY, normalize_money); | ||
types2.setTypeParser(ArrayColumnType.MONEY_ARRAY, normalize_array(normalize_money)); | ||
setTypeParser(ScalarColumnType.MONEY, normalize_money); | ||
setTypeParser(ArrayColumnType.MONEY_ARRAY, normalize_array(normalize_money)); | ||
function toJson(json) { | ||
return json === "null" ? import_driver_adapter_utils.JsonNullMarker : JSON.parse(json); | ||
} | ||
types2.setTypeParser(ScalarColumnType.JSONB, toJson); | ||
types2.setTypeParser(ScalarColumnType.JSON, toJson); | ||
setTypeParser(ScalarColumnType.JSONB, toJson); | ||
setTypeParser(ScalarColumnType.JSON, toJson); | ||
function encodeBuffer(buffer) { | ||
return Array.from(new Uint8Array(buffer)); | ||
} | ||
var parsePgBytes = types2.getTypeParser(ScalarColumnType.BYTEA); | ||
var parsePgBytes = getTypeParser(ScalarColumnType.BYTEA); | ||
function convertBytes(serializedBytes) { | ||
@@ -337,5 +337,5 @@ const buffer = parsePgBytes(serializedBytes); | ||
} | ||
types2.setTypeParser(ScalarColumnType.BYTEA, convertBytes); | ||
var parseBytesArray = types2.getTypeParser(ArrayColumnType.BYTEA_ARRAY); | ||
types2.setTypeParser(ArrayColumnType.BYTEA_ARRAY, (serializedBytesArray) => { | ||
setTypeParser(ScalarColumnType.BYTEA, convertBytes); | ||
var parseBytesArray = getTypeParser(ArrayColumnType.BYTEA_ARRAY); | ||
setTypeParser(ArrayColumnType.BYTEA_ARRAY, (serializedBytesArray) => { | ||
const buffers = parseBytesArray(serializedBytesArray); | ||
@@ -347,4 +347,4 @@ return buffers.map((buf) => buf ? encodeBuffer(buf) : null); | ||
} | ||
types2.setTypeParser(ArrayColumnType.BIT_ARRAY, normalize_array(normalizeBit)); | ||
types2.setTypeParser(ArrayColumnType.VARBIT_ARRAY, normalize_array(normalizeBit)); | ||
setTypeParser(ArrayColumnType.BIT_ARRAY, normalize_array(normalizeBit)); | ||
setTypeParser(ArrayColumnType.VARBIT_ARRAY, normalize_array(normalizeBit)); | ||
function fixArrayBufferValues(values) { | ||
@@ -351,0 +351,0 @@ for (let i = 0; i < values.length; i++) { |
{ | ||
"name": "@prisma/adapter-pg-worker", | ||
"version": "5.11.0-dev.45", | ||
"version": "5.11.0-dev.46", | ||
"description": "Prisma's driver adapter for \"@prisma/pg-worker\"", | ||
@@ -35,3 +35,3 @@ "main": "dist/index.js", | ||
"postgres-array": "3.0.2", | ||
"@prisma/driver-adapter-utils": "5.11.0-dev.45" | ||
"@prisma/driver-adapter-utils": "5.11.0-dev.46" | ||
}, | ||
@@ -43,3 +43,3 @@ "devDependencies": { | ||
"jest-junit": "16.0.0", | ||
"@prisma/pg-worker": "5.11.0-dev.45" | ||
"@prisma/pg-worker": "5.11.0-dev.46" | ||
}, | ||
@@ -46,0 +46,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
46416
+ Added@prisma/debug@5.11.0-dev.46(transitive)
+ Added@prisma/driver-adapter-utils@5.11.0-dev.46(transitive)
- Removed@prisma/debug@5.11.0-dev.45(transitive)
- Removed@prisma/driver-adapter-utils@5.11.0-dev.45(transitive)