feat: Added Timestamp support

This commit is contained in:
Aradhya 2022-07-08 21:05:42 +05:30
parent 88faad6409
commit c97562b736

View file

@ -20,6 +20,14 @@ class Locate(Function):
super().__init__("LOCATE", *terms, **kwargs)
class Timestamp(Function):
def __init__(self, term: str, time=None, alias=None):
if time:
super().__init__("TIMESTAMP", term, time, alias=alias)
else:
super().__init__("TIMESTAMP", term, alias=alias)
GroupConcat = ImportMapper({db_type_is.MARIADB: GROUP_CONCAT, db_type_is.POSTGRES: STRING_AGG})
Match = ImportMapper({db_type_is.MARIADB: MATCH, db_type_is.POSTGRES: TO_TSVECTOR})
@ -96,6 +104,7 @@ class SqlFunctions(Enum):
Max = "max"
Min = "min"
Abs = "abs"
Timestamp = "timestamp"
def _max(dt, fieldname, filters=None, **kwargs):