@cubejs-backend/query-orchestrator
Advanced tools
Comparing version 0.18.17 to 0.18.18
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.18.18](https://github.com/cube-js/cube.js/compare/v0.18.17...v0.18.18) (2020-03-28) | ||
### Features | ||
* Executing SQL logging message that shows final SQL ([26b8758](https://github.com/cube-js/cube.js/commit/26b8758)) | ||
## [0.18.17](https://github.com/cube-js/cube.js/compare/v0.18.16...v0.18.17) (2020-03-24) | ||
@@ -8,0 +19,0 @@ |
@@ -392,9 +392,18 @@ const crypto = require('crypto'); | ||
Array.isArray(this.preAggregation.loadSql) ? this.preAggregation.loadSql : [this.preAggregation.loadSql, []]; | ||
const targetTableName = this.targetTableName(newVersionEntry); | ||
const query = QueryCache.replacePreAggregationTableNames(loadSql, this.preAggregationsTablesToTempTables) | ||
.replace( | ||
this.preAggregation.tableName, | ||
targetTableName | ||
); | ||
this.logger('Executing Load Pre Aggregation SQL', { | ||
queryKey: this.preAggregation.loadSql, | ||
query, | ||
values: params, | ||
targetTableName, | ||
requestId: this.requestId | ||
}); | ||
await client.loadPreAggregationIntoTable( | ||
this.targetTableName(newVersionEntry), | ||
QueryCache.replacePreAggregationTableNames(loadSql, this.preAggregationsTablesToTempTables) | ||
.replace( | ||
this.preAggregation.tableName, | ||
this.targetTableName(newVersionEntry) | ||
), | ||
targetTableName, | ||
query, | ||
params | ||
@@ -404,3 +413,3 @@ ); | ||
await this.loadCache.reset(this.preAggregation); | ||
await this.dropOrphanedTables(client, this.targetTableName(newVersionEntry)); | ||
await this.dropOrphanedTables(client, targetTableName); | ||
await this.loadCache.reset(this.preAggregation); | ||
@@ -413,9 +422,18 @@ } | ||
await client.createSchemaIfNotExists(this.preAggregation.preAggregationsSchema); | ||
const targetTableName = this.targetTableName(newVersionEntry); | ||
const query = QueryCache.replacePreAggregationTableNames(loadSql, this.preAggregationsTablesToTempTables) | ||
.replace( | ||
this.preAggregation.tableName, | ||
targetTableName | ||
); | ||
this.logger('Executing Load Pre Aggregation SQL', { | ||
queryKey: this.preAggregation.loadSql, | ||
query, | ||
values: params, | ||
targetTableName, | ||
requestId: this.requestId | ||
}); | ||
await client.loadPreAggregationIntoTable( | ||
this.targetTableName(newVersionEntry), | ||
QueryCache.replacePreAggregationTableNames(loadSql, this.preAggregationsTablesToTempTables) | ||
.replace( | ||
this.preAggregation.tableName, | ||
this.targetTableName(newVersionEntry) | ||
), | ||
targetTableName, | ||
query, | ||
params | ||
@@ -426,3 +444,3 @@ ); | ||
await this.loadCache.reset(this.preAggregation); | ||
await this.dropOrphanedTables(client, this.targetTableName(newVersionEntry)); | ||
await this.dropOrphanedTables(client, targetTableName); | ||
} | ||
@@ -429,0 +447,0 @@ |
@@ -134,3 +134,5 @@ const crypto = require('crypto'); | ||
const queue = external ? this.getExternalQueue() : this.getQueue(); | ||
return queue.executeInQueue('query', cacheKey, { query, values }, priority, { | ||
return queue.executeInQueue('query', cacheKey, { | ||
queryKey: cacheKey, query, values, requestId | ||
}, priority, { | ||
stageQueryKey: cacheKey, | ||
@@ -146,3 +148,8 @@ requestId | ||
this.driverFactory, | ||
(client, q) => client.query(q.query, q.values), { | ||
(client, q) => { | ||
this.logger('Executing SQL', { | ||
...q | ||
}); | ||
return client.query(q.query, q.values); | ||
}, { | ||
logger: this.logger, | ||
@@ -163,3 +170,8 @@ cacheAndQueueDriver: this.options.cacheAndQueueDriver, | ||
this.externalDriverFactory, | ||
(client, q) => client.query(q.query, q.values), | ||
(client, q) => { | ||
this.logger('Executing SQL', { | ||
...q | ||
}); | ||
return client.query(q.query, q.values); | ||
}, | ||
{ | ||
@@ -166,0 +178,0 @@ logger: this.logger, |
@@ -5,3 +5,3 @@ { | ||
"author": "Statsbot, Inc.", | ||
"version": "0.18.17", | ||
"version": "0.18.18", | ||
"repository": { | ||
@@ -21,3 +21,3 @@ "type": "git", | ||
"ramda": "^0.27.0", | ||
"redis": "^2.8.0" | ||
"redis": "^3.0.2" | ||
}, | ||
@@ -30,3 +30,3 @@ "devDependencies": { | ||
"license": "Apache-2.0", | ||
"gitHead": "f574c7908d9bb1feec13e69fe2396f9f15203270" | ||
"gitHead": "e7a851fa75c56b1a33f6d9db1a3bf6471796134b" | ||
} |
163572
2355
+ Addeddenque@1.5.1(transitive)
+ Addedredis@3.1.2(transitive)
+ Addedredis-errors@1.2.0(transitive)
+ Addedredis-parser@3.0.0(transitive)
- Removeddouble-ended-queue@2.1.0-0(transitive)
- Removedredis@2.8.0(transitive)
- Removedredis-parser@2.6.0(transitive)
Updatedredis@^3.0.2