@makeomatic/clickhouse
Advanced tools
Comparing version 1.9.0 to 1.10.0
{ | ||
"name": "@makeomatic/clickhouse", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Yandex ClickHouse database interface", | ||
@@ -10,11 +10,11 @@ "main": "src/clickhouse.js", | ||
"scripts": { | ||
"launch-docker-image": "docker run -p 8123:8123 --name clickhouse-server yandex/clickhouse-server", | ||
"stop-docker-image": "docker stop clickhouse-server", | ||
"launch-docker-image": "docker compose up -d", | ||
"stop-docker-image": "docker compose down -v", | ||
"pretest": "yarn lint", | ||
"test": "nyc mocha --recursive ./test -R spec", | ||
"test": "c8 mocha --recursive ./test -R spec", | ||
"lint": "eslint ./src", | ||
"report": "nyc report --reporter=lcov > coverage.lcov && codecov", | ||
"report": "c8 report --reporter=lcov > coverage.lcov && codecov", | ||
"simpletest": "mocha --recursive ./test -R spec", | ||
"torturetest": "TORTURE=1 NODE_ENV=test node --expose-gc ./node_modules/.bin/mocha --recursive ./test -R spec", | ||
"clinic": "TORTURE=1 NODE_ENV=test clinic flame -- node --expose-gc ./node_modules/.bin/mocha --recursive ./test -R spec", | ||
"torturetest": "TORTURE=1 NODE_ENV=test ./node_modules/.bin/mocha --expose-gc --recursive ./test -R spec", | ||
"clinic": "TORTURE=1 NODE_ENV=test clinic flame -- ./node_modules/.bin/mocha --expose-gc --recursive ./test -R spec", | ||
"semantic-release": "semantic-release", | ||
@@ -52,5 +52,4 @@ "prepare": "mdep install" | ||
"@makeomatic/deploy": "^12.9.0", | ||
"bluebird": "^3.5.0", | ||
"clinic": "^11.1.0", | ||
"codecov": "^3.8.3", | ||
"c8": "^8.0.1", | ||
"csv-write-stream": "^2.0.0", | ||
"eslint": "^8.34.0", | ||
@@ -60,8 +59,8 @@ "eslint-config-makeomatic": "^5.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"eslint-plugin-unicorn": "^45.0.2", | ||
"eslint-plugin-unicorn": "^48.0.1", | ||
"mocha": "^10.2.0", | ||
"nyc": "^15.1.0", | ||
"p-limit": "^3.1.0", | ||
"semantic-release": "^19.0.5", | ||
"typescript": "^4.9.5" | ||
"semantic-release": "^22.0.5", | ||
"tempy": "1.x.x", | ||
"typescript": "^5.2.2" | ||
}, | ||
@@ -68,0 +67,0 @@ "engines": { |
@@ -241,5 +241,6 @@ const { Pool } = require('undici'); | ||
body.push(null); | ||
} else { | ||
stream.req = body; | ||
} | ||
stream.req = body; | ||
const response = await req; | ||
@@ -246,0 +247,0 @@ await httpResponseHandler(stream, reqData, cb, response); |
@@ -22,2 +22,6 @@ /* eslint-disable max-classes-per-file */ | ||
this.columns = []; | ||
/** | ||
* @type {Duplex} | ||
*/ | ||
this.output = stream; | ||
@@ -43,6 +47,9 @@ } | ||
this.output.emit('progress', data.progress); | ||
} else if (this.withProgress) { | ||
this.output.push(data.row); | ||
} else { | ||
this.output.push(data); | ||
const datum = this.withProgress ? data.row : data; | ||
if (!this.output.push(datum)) { | ||
this.linesProcessed += 1; | ||
this.output.wait(callback); | ||
return | ||
} | ||
} | ||
@@ -181,2 +188,3 @@ | ||
this.format = options.format; | ||
this._resume = null; | ||
@@ -191,4 +199,21 @@ Object.defineProperty(this, 'req', { | ||
RecordStream.prototype.wait = function wait(callback) { | ||
if (this._resume) { | ||
// This is a bug. If it can happen in the wild (eg lost | ||
// network connection), multiplexing needs to be added. | ||
throw new Error('not ready'); | ||
} | ||
if (this.ready) this.ready = false; | ||
this._resume = callback; | ||
} | ||
RecordStream.prototype._read = function read() { | ||
// nothing to do there, when data comes, push will be called | ||
const { _resume } = this; | ||
if (!_resume) { | ||
this.ready = true; | ||
return; | ||
} | ||
this._resume = null; | ||
_resume(); | ||
}; | ||
@@ -228,2 +253,6 @@ | ||
RecordStream.prototype._destroy = function _destroy(err, cb) { | ||
if (!this.req) { | ||
return RecordStream.super_.prototype._destroy.call(this, err, cb) | ||
} | ||
process.nextTick(() => { | ||
@@ -238,2 +267,6 @@ RecordStream.super_.prototype._destroy.call(this, err, (destroyErr) => { | ||
RecordStream.prototype.end = function end(chunk, enc, cb) { | ||
if (!this.req) { | ||
return RecordStream.super_.prototype.end.call(this, chunk, enc, cb) | ||
} | ||
RecordStream.super_.prototype.end.call(this, chunk, enc, () => { | ||
@@ -240,0 +273,0 @@ this.req.push(null); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40753
14
759