File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
packages/cubejs-postgres-driver Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change
1
+ const pg = require ( 'pg' ) ;
2
+ const moment = require ( 'moment' ) ;
1
3
const BaseDriver = require ( '@cubejs-backend/query-orchestrator/driver/BaseDriver' ) ;
2
- const { Pool } = require ( 'pg' ) ;
4
+
5
+ const { Pool } = pg ;
3
6
4
7
const GenericTypeToPostgres = {
5
8
string : 'text'
6
9
} ;
7
10
11
+ pg . types . setTypeParser ( 1114 , str => moment . utc ( str ) . format ( moment . HTML5_FMT . DATETIME_LOCAL_MS ) ) ;
12
+ pg . types . setTypeParser ( 1184 , str => moment . utc ( str ) . format ( moment . HTML5_FMT . DATETIME_LOCAL_MS ) ) ;
13
+
8
14
class PostgresDriver extends BaseDriver {
9
15
constructor ( config ) {
10
16
super ( ) ;
Original file line number Diff line number Diff line change 12
12
},
13
13
"dependencies" : {
14
14
"@cubejs-backend/query-orchestrator" : " ^0.11.0" ,
15
+ "moment" : " ^2.24.0" ,
15
16
"pg" : " ^7.8.0"
16
17
},
17
18
"license" : " Apache-2.0" ,
You can’t perform that action at this time.
0 commit comments