@prisma/adapter-pg-worker
Advanced tools
Comparing version 5.11.0-integration-fix-debug-reexport.3 to 5.11.0-integration-fix-pg-import-ecosystem-tests.1
import type { ConnectionInfo } from '@prisma/driver-adapter-utils'; | ||
import type { DriverAdapter } from '@prisma/driver-adapter-utils'; | ||
import * as pg from '@prisma/pg-worker'; | ||
import pg from '@prisma/pg-worker'; | ||
import type { Query } from '@prisma/driver-adapter-utils'; | ||
@@ -5,0 +5,0 @@ import type { Queryable } from '@prisma/driver-adapter-utils'; |
@@ -39,10 +39,10 @@ "use strict"; | ||
var import_driver_adapter_utils2 = require("@prisma/driver-adapter-utils"); | ||
var pg2 = __toESM(require("@prisma/pg-worker")); | ||
var import_pg_worker2 = __toESM(require("@prisma/pg-worker")); | ||
// src/conversion.ts | ||
var import_driver_adapter_utils = require("@prisma/driver-adapter-utils"); | ||
var pg = __toESM(require("@prisma/pg-worker")); | ||
var import_pg_worker = __toESM(require("@prisma/pg-worker")); | ||
var import_postgres_array = require("postgres-array"); | ||
var types2 = pg.types; | ||
var ScalarColumnType = types2.builtins; | ||
var types = import_pg_worker.default.types; | ||
var ScalarColumnType = types.builtins; | ||
var ArrayColumnType = { | ||
@@ -292,4 +292,4 @@ BIT_ARRAY: 1561, | ||
} | ||
types2.setTypeParser(ScalarColumnType.NUMERIC, normalize_numeric); | ||
types2.setTypeParser(ArrayColumnType.NUMERIC_ARRAY, normalize_array(normalize_numeric)); | ||
types.setTypeParser(ScalarColumnType.NUMERIC, normalize_numeric); | ||
types.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); | ||
types.setTypeParser(ScalarColumnType.TIME, normalize_time); | ||
types.setTypeParser(ArrayColumnType.TIME_ARRAY, normalize_array(normalize_time)); | ||
types.setTypeParser(ScalarColumnType.TIMETZ, normalize_timez); | ||
types.setTypeParser(ScalarColumnType.DATE, normalize_date); | ||
types.setTypeParser(ArrayColumnType.DATE_ARRAY, normalize_array(normalize_date)); | ||
types.setTypeParser(ScalarColumnType.TIMESTAMP, normalize_timestamp); | ||
types.setTypeParser(ArrayColumnType.TIMESTAMP_ARRAY, normalize_array(normalize_timestamp)); | ||
types.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)); | ||
types.setTypeParser(ScalarColumnType.MONEY, normalize_money); | ||
types.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); | ||
types.setTypeParser(ScalarColumnType.JSONB, toJson); | ||
types.setTypeParser(ScalarColumnType.JSON, toJson); | ||
function encodeBuffer(buffer) { | ||
return Array.from(new Uint8Array(buffer)); | ||
} | ||
var parsePgBytes = types2.getTypeParser(ScalarColumnType.BYTEA); | ||
var parsePgBytes = types.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) => { | ||
types.setTypeParser(ScalarColumnType.BYTEA, convertBytes); | ||
var parseBytesArray = types.getTypeParser(ArrayColumnType.BYTEA_ARRAY); | ||
types.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)); | ||
types.setTypeParser(ArrayColumnType.BIT_ARRAY, normalize_array(normalizeBit)); | ||
types.setTypeParser(ArrayColumnType.VARBIT_ARRAY, normalize_array(normalizeBit)); | ||
function fixArrayBufferValues(values) { | ||
@@ -459,3 +459,3 @@ for (let i = 0; i < values.length; i++) { | ||
constructor(client, options) { | ||
if (!(client instanceof pg2.Pool)) { | ||
if (!(client instanceof import_pg_worker2.default.Pool)) { | ||
throw new TypeError(`PrismaPg must be initialized with an instance of Pool: | ||
@@ -462,0 +462,0 @@ import { Pool } from 'pg' |
{ | ||
"name": "@prisma/adapter-pg-worker", | ||
"version": "5.11.0-integration-fix-debug-reexport.3", | ||
"version": "5.11.0-integration-fix-pg-import-ecosystem-tests.1", | ||
"description": "Prisma's driver adapter for \"@prisma/pg-worker\"", | ||
@@ -35,10 +35,10 @@ "main": "dist/index.js", | ||
"postgres-array": "3.0.2", | ||
"@prisma/driver-adapter-utils": "5.11.0-integration-fix-debug-reexport.3" | ||
"@prisma/driver-adapter-utils": "5.11.0-integration-fix-pg-import-ecosystem-tests.1" | ||
}, | ||
"devDependencies": { | ||
"@swc/core": "1.4.1", | ||
"@swc/core": "1.4.2", | ||
"@swc/jest": "0.2.36", | ||
"jest": "29.7.0", | ||
"jest-junit": "16.0.0", | ||
"@prisma/pg-worker": "5.11.0-integration-fix-debug-reexport.3" | ||
"@prisma/pg-worker": "5.11.0-integration-fix-pg-import-ecosystem-tests.1" | ||
}, | ||
@@ -45,0 +45,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46753
+ Added@prisma/debug@5.11.0-integration-fix-pg-import-ecosystem-tests.1(transitive)
+ Added@prisma/driver-adapter-utils@5.11.0-integration-fix-pg-import-ecosystem-tests.1(transitive)
- Removed@prisma/debug@5.11.0-integration-fix-debug-reexport.3(transitive)
- Removed@prisma/driver-adapter-utils@5.11.0-integration-fix-debug-reexport.3(transitive)
Updated@prisma/driver-adapter-utils@5.11.0-integration-fix-pg-import-ecosystem-tests.1