@@ -2,8 +2,8 @@ import { IValue, _IIndex, _ISelection, _IType, _ISchema } from '../interfaces-pr
2
2
import { DataType , CastError , IType , QueryError , nil } from '../interfaces.ts' ;
3
3
import { nullIsh } from '../utils.ts' ;
4
4
import { Evaluator , Value } from '../evaluator.ts' ;
5
- import { parseArrayLiteral } from 'https://deno.land/x/pgsql_ast_parser@10.1.0 /mod.ts' ;
6
- import { parseGeometricLiteral } from 'https://deno.land/x/pgsql_ast_parser@10.1.0 /mod.ts' ;
5
+ import { parseArrayLiteral } from 'https://deno.land/x/pgsql_ast_parser@10.3.1 /mod.ts' ;
6
+ import { parseGeometricLiteral } from 'https://deno.land/x/pgsql_ast_parser@10.3.1 /mod.ts' ;
7
7
import { bufCompare , bufFromString , bufToString , TBuffer } from '../misc/buffer-deno.ts' ;
8
8
import { TypeBase } from './datatype-base.ts' ;
9
9
import { BoxType , CircleType , LineType , LsegType , PathType , PointType , PolygonType } from './datatypes-geometric.ts' ;
@@ -589,7 +589,8 @@ export const Types = {
589
589
[ DataType . uuid ] : new UUIDtype ( ) as _IType ,
590
590
[ DataType . date ] : new TimestampType ( DataType . date ) as _IType ,
591
591
[ DataType . interval ] : new IntervalType ( ) as _IType ,
592
- [ DataType . time ] : new TimeType ( ) as _IType ,
592
+ [ DataType . time ] : new TimeType ( DataType . time ) as _IType ,
593
+ [ DataType . timetz ] : new TimeType ( DataType . timetz ) as _IType ,
593
594
[ DataType . jsonb ] : new JSONBType ( DataType . jsonb ) as _IType ,
594
595
[ DataType . regtype ] : new RegTypeImpl ( ) as _IType ,
595
596
[ DataType . regclass ] : new RegClassImpl ( ) as _IType ,
@@ -646,12 +647,13 @@ function makeText(len: number | nil = null) {
646
647
return got ;
647
648
}
648
649
649
- const timestamps = new Map < number | null , _IType > ( ) ;
650
+ const timestamps = new Map < string , _IType > ( ) ;
650
651
function makeTimestamp ( primary : DataType , len : number | nil = null ) {
651
652
len = len ?? null ;
652
- let got = timestamps . get ( len ) ;
653
+ const key = primary + '/' + len ;
654
+ let got = timestamps . get ( key ) ;
653
655
if ( ! got ) {
654
- timestamps . set ( len , got = new TimestampType ( primary , len ) ) ;
656
+ timestamps . set ( key , got = new TimestampType ( primary , len ) ) ;
655
657
}
656
658
return got ;
657
659
}
@@ -684,13 +686,12 @@ export const typeSynonyms: { [key: string]: DataType } = {
684
686
'real' : DataType . float ,
685
687
'money' : DataType . float ,
686
688
687
- 'timestamptz' : DataType . timestamp , // => todo support timestamptz
688
- 'timestamp with time zone' : DataType . timestamp , // => todo support timestamptz
689
+ 'timestamp with time zone' : DataType . timestamptz ,
689
690
'timestamp without time zone' : DataType . timestamp ,
690
691
691
692
'boolean' : DataType . bool ,
692
693
693
- 'time with time zone' : DataType . time ,
694
+ 'time with time zone' : DataType . timetz ,
694
695
'time without time zone' : DataType . time ,
695
696
}
696
697
0 commit comments