Exemplo n.º 1
0
 def __init__(self,
              table,
              whereclause,
              bind=None,
              returning=None,
              order_by=None,
              limit=None,
              offset=None,
              **kwargs):
     Delete.__init__(self, table, whereclause, bind, returning, **kwargs)
     self._order_by_clause = ClauseList(*util.to_list(order_by) or [])
     self._limit = limit
     self._offset = offset
def test_connection_query(connection):
    password = "******"
    statement = Delete(User).where(User.name == 'John').where(User.password == password)
    connection.execute(statement)
    assert len(xray_recorder.current_segment().subsegments) == 1
    sql_meta = xray_recorder.current_segment().subsegments[0].sql
    assert sql_meta['sanitized_query'].startswith('DELETE FROM users')
    assert sql_meta['url'] == 'sqlite:///:memory:'
    assert password not in sql_meta['sanitized_query']
Exemplo n.º 3
0
 def get_children(self, column_collections=True, **kwargs):
     children = Delete.get_children(column_collections, **kwargs)
     return children + [self._order_by_clause]
Exemplo n.º 4
0
 def __init__(self, table, whereclause, bind=None, returning=None,
              order_by=None, limit=None, offset=None, **kwargs):
     Delete.__init__(self, table, whereclause, bind, returning, **kwargs)
     self._order_by_clause = ClauseList(*util.to_list(order_by) or [])
     self._limit = limit
     self._offset = offset
Exemplo n.º 5
0
 def get_children(self, column_collections=True, **kwargs):
     children = Delete.get_children(column_collections, **kwargs)
     return children + [self._order_by_clause]
Exemplo n.º 6
0
async def cleanup() -> None:
    print("cleanup: Start.")
    async with async_session.begin() as session:
        await session.execute(Delete(TrackPoint))
        await session.execute(Delete(User))
    print("cleanup: Stop.")