From 6249052bc8717dd9e83f7b54262643f5cd5f1c37 Mon Sep 17 00:00:00 2001 From: jeromew Date: Mon, 18 Mar 2019 17:45:55 +0000 Subject: [PATCH] Add test for copy from client reuse --- test/copy-from.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/copy-from.js b/test/copy-from.js index c7e0639..cace38a 100644 --- a/test/copy-from.js +++ b/test/copy-from.js @@ -73,3 +73,32 @@ var testSingleEnd = function() { } testSingleEnd() + +var testClientReuse = function() { + var fromClient = client() + fromClient.query('CREATE TEMP TABLE numbers(num int)') + var txt = 'COPY numbers FROM STDIN'; + var count = 0; + var countMax = 2; + var card = 100000; + var runStream = function() { + var stream = fromClient.query(copy(txt)) + stream.on('end', function() { + count++; + if (count