Skip to content

Commit

Permalink
fix(postgres-driver): ERROR: type "string" does not exist
Browse files Browse the repository at this point in the history
Fixes #176
  • Loading branch information
paveltiunov committed Aug 2, 2019
1 parent bdb01a3 commit d472e89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/cubejs-postgres-driver/driver/PostgresDriver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const BaseDriver = require('@cubejs-backend/query-orchestrator/driver/BaseDriver');
const { Pool } = require('pg');

const GenericTypeToPostgres = {
string: 'text'
};

class PostgresDriver extends BaseDriver {
constructor(config) {
super();
Expand Down Expand Up @@ -55,6 +59,10 @@ class PostgresDriver extends BaseDriver {
param(paramIndex) {
return '$' + (paramIndex + 1);
}

fromGenericType(columnType) {
return GenericTypeToPostgres[columnType] || super.fromGenericType(columnType);
}
}

module.exports = PostgresDriver;

0 comments on commit d472e89

Please sign in to comment.