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):
124124 SUPPORTS_INDEXES = False
125125 TYPE_CLASSES : Dict [str , type ] = {}
126126
127+ PLACEHOLDER_TABLE = None # Used for Oracle
128+
127129 def offset_limit (self , offset : Optional [int ] = None , limit : Optional [int ] = None ):
128130 if offset :
129131 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):
8686 "VARCHAR2" : Text ,
8787 }
8888 ROUNDS_ON_PREC_LOSS = True
89+ PLACEHOLDER_TABLE = "DUAL"
8990
9091 def quote (self , s : str ):
9192 return f'"{ s } "'
@@ -152,6 +153,9 @@ def parse_type(
152153 def set_timezone_to_utc (self ) -> str :
153154 return "ALTER SESSION SET TIME_ZONE = 'UTC'"
154155
156+ def current_timestamp (self ) -> str :
157+ return "LOCALTIMESTAMP"
158+
155159
156160class Oracle (ThreadedDatabase ):
157161 dialect = Dialect ()
Original file line number Diff line number Diff line change @@ -601,6 +601,9 @@ def compile(self, parent_c: Compiler) -> str:
601601
602602 if self .table :
603603 select += " FROM " + c .compile (self .table )
604+ elif c .dialect .PLACEHOLDER_TABLE :
605+ select += f" FROM { c .dialect .PLACEHOLDER_TABLE } "
606+
604607
605608 if self .where_exprs :
606609 select += " WHERE " + " AND " .join (map (c .compile , self .where_exprs ))
You can’t perform that action at this time.
0 commit comments