Merge pull request #426 from CartoDB/upgrade-cartodb-psql

Upgrade cartodb-psql to 0.10.0
This commit is contained in:
Raul Ochoa 2017-08-11 13:30:25 +02:00 committed by GitHub
commit 61bb1ca155
11 changed files with 957 additions and 1355 deletions

View File

@ -3,12 +3,15 @@
## 1.47.1
Released 2017-mm-dd
Announcements:
* Upgrade cartodb-psql to 0.10.0.
* Content edits to doc/version.md
## 1.47.0
Released 2017-08-10
Announcements:
- Now export and query APIs respond with `429 You are over the limits` when a query or export command overcomes the pre-configured user's timeout.
* Now export and query APIs respond with `429 You are over the limits` when a query or export command overcomes the pre-configured user's timeout.
## 1.46.1

View File

@ -137,7 +137,7 @@ QueryController.prototype.handleQuery = function (req, res) {
checkAborted('queryExplain');
var pg = new PSQL(authDbParams, {}, { destroyOnError: true });
var pg = new PSQL(authDbParams);
var skipCache = !!dbopts.authenticated;
self.queryTables.getAffectedTablesFromQuery(pg, sql, skipCache, function(err, result) {

View File

@ -80,7 +80,7 @@ OgrFormat.prototype.toOGR = function(options, out_format, out_filename, callback
function fetchColumns() {
var colsql = 'SELECT * FROM (' + sql + ') as _cartodbsqlapi LIMIT 0';
pg = new PSQL(dbopts, {}, { destroyOnError: true });
pg = new PSQL(dbopts);
pg.query(colsql, this);
},
// jshint maxcomplexity:9

View File

@ -119,7 +119,7 @@ PostgresFormat.prototype.sendResponse = function(opts, callback) {
this.start_time = Date.now();
this.client = new PSQL(opts.dbopts, {}, { destroyOnError: true });
this.client = new PSQL(opts.dbopts);
this.client.eventedQuery(sql, function(err, query, queryCanceller) {
that.queryCanceller = queryCanceller;
if (err) {

View File

@ -19,7 +19,7 @@ JobCanceller.prototype.cancel = function (job, callback) {
};
function doCancel(job_id, userDatabaseMetadata, callback) {
var pg = new PSQL(userDatabaseMetadata, {}, { destroyOnError: true });
var pg = new PSQL(userDatabaseMetadata);
getQueryPID(pg, job_id, function (err, pid) {
if (err) {

View File

@ -15,7 +15,7 @@ QueryRunner.prototype.run = function (job_id, sql, user, timeout, callback) {
return callback(err);
}
var pg = new PSQL(userDatabaseMetadata, {}, { destroyOnError: true });
var pg = new PSQL(userDatabaseMetadata);
pg.query('SET statement_timeout=' + timeout, function (err) {
if(err) {

2282
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
"dependencies": {
"bintrees": "1.0.1",
"bunyan": "1.8.1",
"cartodb-psql": "0.7.1",
"cartodb-psql": "0.10.0",
"cartodb-query-tables": "0.2.0",
"cartodb-redis": "0.14.0",
"debug": "2.2.0",

View File

@ -29,15 +29,6 @@ describe('system-queries', function() {
],
api_key_works: true,
no_api_key_works: true
},
{
desc: 'Set queries will FAIL for both api_key and no_api_key queries',
queries: [
' SET work_mem TO 80000',
' set statement_timeout TO 400'
],
api_key_works: false,
no_api_key_works: false
}
];

View File

@ -45,7 +45,7 @@ function runQueryHelper(job, callback) {
return callback(err);
}
var pg = new PSQL(userDatabaseMetadata, {}, { destroyOnError: true });
var pg = new PSQL(userDatabaseMetadata);
sql = '/* ' + job_id + ' */ ' + sql;

View File

@ -55,7 +55,7 @@ function runQueryHelper(job, callback) {
return callback(err);
}
var pg = new PSQL(userDatabaseMetadata, {}, { destroyOnError: true });
var pg = new PSQL(userDatabaseMetadata);
sql = '/* ' + job_id + ' */ ' + sql;