Source code for tortoise.contrib.postgres.functions
from pypika.terms import Function, Term
[docs]class ToTsVector(Function):
"""
to to_tsvector function
"""
def __init__(self, field: Term) -> None:
super().__init__("TO_TSVECTOR", field)
[docs]class ToTsQuery(Function):
"""
to_tsquery function
"""
def __init__(self, field: Term) -> None:
super().__init__("TO_TSQUERY", field)
[docs]class PlainToTsQuery(Function):
"""
plainto_tsquery function
"""
def __init__(self, field: Term) -> None:
super().__init__("PLAINTO_TSQUERY", field)
[docs]class Random(Function):
"""
Generate random number.
:samp:`Random()`
"""
def __init__(self, alias=None) -> None:
super().__init__("RANDOM", alias=alias)