UNPKG

postgrejs

Version:

Professional PostgreSQL client NodeJS

29 lines (28 loc) 836 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ArrayByteaType = exports.ByteaType = void 0; const tslib_1 = require("tslib"); // @ts-ignore -- no type definitions for decodeBytea const postgres_bytea_1 = tslib_1.__importDefault(require("postgres-bytea")); const constants_js_1 = require("../constants.js"); exports.ByteaType = { name: 'bytea', oid: constants_js_1.DataTypeOIDs.bytea, jsType: 'Buffer', parseBinary(v) { return v; }, encodeBinary(buf, v) { buf.writeBuffer(v); }, parseText: postgres_bytea_1.default, isType(v) { return v instanceof Buffer; }, }; exports.ArrayByteaType = { ...exports.ByteaType, name: '_bytea', oid: constants_js_1.DataTypeOIDs._bytea, elementsOID: constants_js_1.DataTypeOIDs.bytea, };