@cubejs-backend/postgres-driver
Advanced tools
Comparing version
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.17.10](https://github.com/cube-js/cube.js/compare/v0.17.9...v0.17.10) (2020-02-20) | ||
### Features | ||
* Support external rollups from readonly source ([#395](https://github.com/cube-js/cube.js/issues/395)) ([b17e841](https://github.com/cube-js/cube.js/commit/b17e841)) | ||
## [0.17.9](https://github.com/cube-js/cube.js/compare/v0.17.8...v0.17.9) (2020-02-18) | ||
@@ -8,0 +19,0 @@ |
@@ -12,2 +12,8 @@ const pg = require('pg'); | ||
const DataTypeMapping = {}; | ||
Object.entries(types.builtins).forEach(pair => { | ||
const [key, value] = pair; | ||
DataTypeMapping[value] = key; | ||
}); | ||
const timestampDataTypes = [1114, 1184]; | ||
@@ -48,3 +54,3 @@ | ||
async query(query, values) { | ||
async queryResponse(query, values) { | ||
const client = await this.pool.connect(); | ||
@@ -70,3 +76,3 @@ try { | ||
}); | ||
return res && res.rows; | ||
return res; | ||
} finally { | ||
@@ -77,2 +83,21 @@ await client.release(); | ||
async query(query, values) { | ||
return (await this.queryResponse(query, values)).rows; | ||
} | ||
async downloadQueryResults(query, values) { | ||
const res = await this.queryResponse(query, values); | ||
return { | ||
rows: res.rows, | ||
types: res.fields.map(f => ({ | ||
name: f.name, | ||
type: this.toGenericType(DataTypeMapping[f.dataTypeID].toLowerCase()) | ||
})), | ||
}; | ||
} | ||
readOnly() { | ||
return !!this.config.readOnly; | ||
} | ||
async uploadTable(table, columns, tableData) { | ||
@@ -79,0 +104,0 @@ if (!tableData.rows) { |
@@ -5,3 +5,3 @@ { | ||
"author": "Statsbot, Inc.", | ||
"version": "0.17.9", | ||
"version": "0.17.10", | ||
"repository": { | ||
@@ -21,3 +21,3 @@ "type": "git", | ||
"dependencies": { | ||
"@cubejs-backend/query-orchestrator": "^0.17.9", | ||
"@cubejs-backend/query-orchestrator": "^0.17.10", | ||
"moment": "^2.24.0", | ||
@@ -34,3 +34,3 @@ "pg": "^7.10.0" | ||
}, | ||
"gitHead": "9f044d37191ba6e7c6fe6e178a01dbc52e06efa5" | ||
"gitHead": "70d41c2d5aa7b3e2061730ab7fe9bcbc125bd220" | ||
} |
28647
3.11%118
21.65%