pg-copy-streams-binary
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -45,2 +45,6 @@ const ieee754 = require('ieee754') | ||
// varchar | ||
const varcharsend = textsend | ||
const varcharrecv = textrecv | ||
// json | ||
@@ -152,2 +156,3 @@ const json_send = function (buf, value) { | ||
if (types[type].oid === typoid) { | ||
// eslint-disable-next-line no-unused-vars | ||
found = true | ||
@@ -198,2 +203,3 @@ break | ||
text: { oid: 25, send: textsend, recv: textrecv }, | ||
varchar: { oid: 1043, send: varcharsend, recv: varcharrecv }, | ||
json: { oid: 114, send: json_send, recv: json_recv }, | ||
@@ -209,2 +215,3 @@ jsonb: { oid: 3802, send: jsonb_send, recv: jsonb_recv }, | ||
_text: { oid: 1009, send: array_send.bind(null, 'text'), recv: array_recv }, | ||
_varchar: { oid: 1015, send: array_send.bind(null, 'varchar'), recv: array_recv }, | ||
_json: { oid: 199, send: array_send.bind(null, 'json'), recv: array_recv }, | ||
@@ -211,0 +218,0 @@ _jsonb: { oid: 3807, send: array_send.bind(null, 'jsonb'), recv: array_recv }, |
{ | ||
"name": "pg-copy-streams-binary", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Streams for parsing and deparsing the COPY binary format", | ||
@@ -28,12 +28,12 @@ "main": "index.js", | ||
"devDependencies": { | ||
"async": "^2.6.2", | ||
"async": "^3.2.1", | ||
"concat-stream": "^2.0.0", | ||
"deeper": "^2.1.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^3.4.1", | ||
"gonna": "0.0.0", | ||
"mocha": "^7.2.0", | ||
"pg": "^7.9.0", | ||
"pg-copy-streams": "^5.0.0", | ||
"mocha": "^9.1.0", | ||
"pg": "^8.7.1", | ||
"pg-copy-streams": "^6.0.1", | ||
"prettier": "^2.0.5" | ||
@@ -40,0 +40,0 @@ }, |
@@ -288,2 +288,3 @@ ## pg-copy-streams-binary | ||
- text | ||
- varchar | ||
- json | ||
@@ -299,5 +300,9 @@ - jsonb | ||
### version 2.1.1 - published 2021-08-25 | ||
- Add varchar type support | ||
### version 2.0.1 - published 2020-10-05 | ||
- Upgrade bl@4.0.3 | ||
- Upgrade bl@4.0.3 | ||
@@ -304,0 +309,0 @@ ### version 2.0.0 - published 2020-06-17 |
@@ -31,2 +31,5 @@ const pgtypes = require('../lib/pg_types') | ||
{ t: 'text', v: 'utf8 éà', r: new BP().word32be(9).put(Buffer.from('utf8 éà', 'utf-8')).buffer() }, | ||
{ t: 'varchar', v: null, r: new BP().word32be(-1).buffer() }, | ||
{ t: 'varchar', v: 'hello', r: new BP().word32be(5).put(Buffer.from('hello')).buffer() }, | ||
{ t: 'varchar', v: 'utf8 éà', r: new BP().word32be(9).put(Buffer.from('utf8 éà', 'utf-8')).buffer() }, | ||
{ t: 'json', v: null, r: new BP().word32be(-1).buffer() }, | ||
@@ -188,2 +191,21 @@ { t: 'json', v: { a: true, b: [1, 7] }, r: new BP().word32be(20).string('{"a":true,"b":[1,7]}', 'utf-8').buffer() }, | ||
}, | ||
{ t: '_varchar', v: null, r: new BP().word32be(-1).buffer() }, | ||
{ | ||
t: '_varchar', | ||
v: ['ab', 'cd'], | ||
r: new BP() | ||
.word32be(32) | ||
.word32be(1) | ||
.word32be(0) | ||
.word32be(types['varchar'].oid) | ||
.word32be(2) | ||
.word32be(1) | ||
.word32be(2) | ||
.word8(97) | ||
.word8(98) | ||
.word32be(2) | ||
.word8(99) | ||
.word8(100) | ||
.buffer(), | ||
}, | ||
{ t: '_json', v: null, r: new BP().word32be(-1).buffer() }, | ||
@@ -190,0 +212,0 @@ { |
67116
1589
373