44from .base import ThreadedDatabase , import_helper , ConnectError , QueryError
55from .base import DEFAULT_DATETIME_PRECISION , DEFAULT_NUMERIC_PRECISION
66
7- SESSION_TIME_ZONE = None # Changed by the tests
7+ SESSION_TIME_ZONE = None # Changed by the tests
8+
89
910@import_helper ("oracle" )
1011def import_oracle ():
@@ -89,6 +90,7 @@ def _parse_type(
8990 regexps = {
9091 r"TIMESTAMP\((\d)\) WITH LOCAL TIME ZONE" : Timestamp ,
9192 r"TIMESTAMP\((\d)\) WITH TIME ZONE" : TimestampTZ ,
93+ r"TIMESTAMP\((\d)\)" : Timestamp ,
9294 }
9395 for regexp , t_cls in regexps .items ():
9496 m = re .match (regexp + "$" , type_repr )
@@ -99,14 +101,23 @@ def _parse_type(
99101 rounds = self .ROUNDS_ON_PREC_LOSS ,
100102 )
101103
102- return super ()._parse_type (type_repr , col_name , type_repr , datetime_precision , numeric_precision , numeric_scale )
104+ return super ()._parse_type (
105+ table_name , col_name , type_repr , datetime_precision , numeric_precision , numeric_scale
106+ )
103107
104108 def offset_limit (self , offset : Optional [int ] = None , limit : Optional [int ] = None ):
105109 if offset :
106110 raise NotImplementedError ("No support for OFFSET in query" )
107111
108112 return f"FETCH NEXT { limit } ROWS ONLY"
109113
114+ def concat (self , l : List [str ]) -> str :
115+ joined_exprs = " || " .join (l )
116+ return f"({ joined_exprs } )"
117+
118+ def timestamp_value (self , t : DbTime ) -> str :
119+ return "timestamp '%s'" % t .isoformat (" " )
120+
110121 def normalize_uuid (self , value : str , coltype : ColType_UUID ) -> str :
111122 # Cast is necessary for correct MD5 (trimming not enough)
112123 return f"CAST(TRIM({ value } ) AS VARCHAR(36))"
0 commit comments