This repository was archived by the owner on May 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ class BaseDialect(AbstractDialect):
124
124
SUPPORTS_INDEXES = False
125
125
TYPE_CLASSES : Dict [str , type ] = {}
126
126
127
+ PLACEHOLDER_TABLE = None # Used for Oracle
128
+
127
129
def offset_limit (self , offset : Optional [int ] = None , limit : Optional [int ] = None ):
128
130
if offset :
129
131
raise NotImplementedError ("No support for OFFSET in query" )
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ class Dialect(BaseDialect, Mixin_Schema):
86
86
"VARCHAR2" : Text ,
87
87
}
88
88
ROUNDS_ON_PREC_LOSS = True
89
+ PLACEHOLDER_TABLE = "DUAL"
89
90
90
91
def quote (self , s : str ):
91
92
return f'"{ s } "'
@@ -152,6 +153,9 @@ def parse_type(
152
153
def set_timezone_to_utc (self ) -> str :
153
154
return "ALTER SESSION SET TIME_ZONE = 'UTC'"
154
155
156
+ def current_timestamp (self ) -> str :
157
+ return "LOCALTIMESTAMP"
158
+
155
159
156
160
class Oracle (ThreadedDatabase ):
157
161
dialect = Dialect ()
Original file line number Diff line number Diff line change @@ -601,6 +601,9 @@ def compile(self, parent_c: Compiler) -> str:
601
601
602
602
if self .table :
603
603
select += " FROM " + c .compile (self .table )
604
+ elif c .dialect .PLACEHOLDER_TABLE :
605
+ select += f" FROM { c .dialect .PLACEHOLDER_TABLE } "
606
+
604
607
605
608
if self .where_exprs :
606
609
select += " WHERE " + " AND " .join (map (c .compile , self .where_exprs ))
You can’t perform that action at this time.
0 commit comments