def by_sql(cls, sql, engine_or_session):
        """
        Query with sql statement or texture sql.
        """
        ses, auto_close = ensure_session(engine_or_session)
        result = ses.query(cls).from_statement(sql).all()
        if auto_close:
            ses.close()
        return result
def by_sql ( cls , sql , engine_or_session ) : ses , auto_close = ensure_session ( engine_or_session ) result = ses . query ( cls ) . from_statement ( sql ) . all ( ) if auto_close : ses . close ( ) return result
Query with sql statement or texture sql.