Exemplo n.º 1
0
 def orderby(self, orders: Iterable[str]):
     __orders = quote_join('"', orders)
     return Query(f'{self.sql} ORDER BY {__orders}', self.values)
Exemplo n.º 2
0
 def __init__(self, cols: Iterable, table: str):
     __columns = quote_join('"', cols)
     self.sql = f'SELECT DISTINCT {__columns} FROM "{table}"'
     self.cols = cols
     self.values = None
Exemplo n.º 3
0
 def __init__(self, table: str, cols: Iterable):
     __columns = quote_join('"', cols)
     __values = ', '.join([f'${i+1}' for i in range(len(cols))])
     self.sql = f'INSERT INTO "{table}"({__columns}) VALUES({__values})'