query_tables_update: Update to 0.6.0 (#613)

This commit is contained in:
Raúl Marín 2019-09-13 13:45:43 +02:00 committed by GitHub
parent df523960a2
commit d57f00c4e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 23 deletions

View File

@ -5,6 +5,8 @@ Released 2019-mm-dd
Breaking:
* Remove in-memory table cache and `/cachestatus` endpoint.
* Update `cartodb-query-tables` to version [`0.6.0`](https://github.com/CartoDB/node-cartodb-query-tables/blob/0964b6cce5d3d3e149af8d6685e2fe7fa87a3d32/NEWS.md#version-060).
* Update `cartodb-psql` to version [`0.14.0`](https://github.com/CartoDB/node-cartodb-psql/blob/d8dae1d9726da7fb96806062247649fd6fb3c2f4/NEWS.md#version-0140-2019-09-10).
Announcements:
* Update `cartodb-query-tables` to version [`0.5.0`](https://github.com/CartoDB/node-cartodb-query-tables/releases/tag/0.5.0)

View File

@ -1,7 +1,7 @@
'use strict';
const PSQL = require('cartodb-psql');
const queryTables = require('cartodb-query-tables');
const queryTables = require('cartodb-query-tables').queryTables;
module.exports = function affectedTables () {
return function affectedTablesMiddleware (req, res, next) {
@ -9,7 +9,7 @@ module.exports = function affectedTables () {
const { authDbParams } = res.locals;
const pg = new PSQL(authDbParams);
queryTables.getAffectedTablesFromQuery(pg, sql, (err, affectedTables) => {
queryTables.getQueryMetadataModel(pg, sql, (err, affectedTables) => {
if (err) {
const message = (err && err.message) || 'unknown error';
console.error('Error on query explain \'%s\': %s', sql, message);

44
package-lock.json generated
View File

@ -7,7 +7,7 @@
"@carto/fqdn-sync": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/@carto/fqdn-sync/-/fqdn-sync-0.2.2.tgz",
"integrity": "sha1-zXxkXtZmkKCSSbVU0lSg9Tljstw="
"integrity": "sha512-hvD8HlzgWkFsCswIHs+wtrIK8HEGC2L8jny3JY00lQ/xwurLxWR+xMYpgjI821INmjEPRFtajFQkniB1HxNBkQ=="
},
"abbrev": {
"version": "1.0.9",
@ -76,7 +76,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@ -155,7 +155,7 @@
"basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
"integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=",
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
"requires": {
"safe-buffer": "5.1.2"
}
@ -246,7 +246,7 @@
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8="
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
},
"buffer-writer": {
"version": "1.0.1",
@ -322,9 +322,12 @@
}
},
"cartodb-query-tables": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cartodb-query-tables/-/cartodb-query-tables-0.5.0.tgz",
"integrity": "sha512-xVHWKF6DMSn/Ksqhm6uNNnr8ckWDWWzsTz9XsoELAW5ZpCJDaxn3YGxgRtD1bwHdQd1tjDVeud/pRk/mCFWpmQ=="
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/cartodb-query-tables/-/cartodb-query-tables-0.6.0.tgz",
"integrity": "sha512-tnZ8K1UWVvYZ9Jg0jFAacgOpbF7dJYLcHMUsrAwfZrksU/PV57P3Dxo1msBYFtWsUoCdaVFiX+0FefNDWiK0Xw==",
"requires": {
"decimal.js": "10.2.0"
}
},
"cartodb-redis": {
"version": "2.1.0",
@ -426,7 +429,7 @@
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha1-sRwn2IuP8fvgcGQ8+UsMea4bCq8=",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@ -440,7 +443,7 @@
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
@ -514,6 +517,11 @@
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
},
"decimal.js": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.0.tgz",
"integrity": "sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw=="
},
"deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
@ -677,7 +685,7 @@
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"requires": {
"is-arrayish": "^0.2.1"
}
@ -1402,7 +1410,7 @@
"get-caller-file": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
"integrity": "sha1-+Xj6TJDR3+f/LWvtoqUV5xO9z0o="
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
},
"getpass": {
"version": "0.1.7",
@ -1820,7 +1828,7 @@
"dependencies": {
"nan": {
"version": "2.10.0",
"resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
"dev": true
}
@ -2562,7 +2570,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
@ -2717,18 +2725,18 @@
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0="
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safe-json-stringify": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz",
"integrity": "sha1-NW5EvJjx+TzkXfFLzXwBzahuCv0=",
"integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==",
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sax": {
"version": "1.2.4",
@ -2842,7 +2850,7 @@
"spdx-exceptions": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
"integrity": "sha1-LqRQrudPKom/uUUZwH/Nb0EyKXc="
"integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA=="
},
"spdx-expression-parse": {
"version": "3.0.0",
@ -3137,7 +3145,7 @@
"validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
"integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=",
"integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
"requires": {
"spdx-correct": "^3.0.0",
"spdx-expression-parse": "^3.0.0"

View File

@ -22,7 +22,7 @@
"bintrees": "1.0.1",
"bunyan": "1.8.1",
"cartodb-psql": "0.14.0",
"cartodb-query-tables": "^0.5.0",
"cartodb-query-tables": "0.6.0",
"cartodb-redis": "2.1.0",
"debug": "^4.1.1",
"express": "^4.16.4",

View File

@ -5,7 +5,7 @@ require('../helper');
var server = require('../../app/server')();
var assert = require('../support/assert');
var querystring = require('querystring');
var QueryTables = require('cartodb-query-tables');
var QueryTables = require('cartodb-query-tables').queryTables;
var _ = require('underscore');
describe('Surrogate-Key header', function() {
@ -32,7 +32,7 @@ describe('Surrogate-Key header', function() {
var surrogateKeys = surrogateKey.split(" ");
var expectedSurrogateKeys = new QueryTables.DatabaseTablesEntry(expectedTables).key();
var expectedSurrogateKeys = new QueryTables.QueryMetadata(expectedTables).key();
assert.equal(surrogateKeys.length, expectedSurrogateKeys.length);