(sql, dbname, print_rows)
Run sql statement once on database

    This is the default run mode for statements
Run sql statement once on database
Run sql statement once on database
def run_once(sql, dbname, print_rows):
    """Run sql statement once on database

    This is the default run mode for statements
    """
    with connections[dbname].cursor() as cursor, timer(dbname):
        cursor.execute(sql)
        if print_rows:
            rows = fetch_dicts(cursor)
            for row in rows:
                pprint.pprint(row)
            print("({} rows from {})".format(len(rows), dbname))
def run_once ( sql , dbname , print_rows ) : with connections [ dbname ] . cursor ( ) as cursor , timer ( dbname ) : cursor . execute ( sql ) if print_rows : rows = fetch_dicts ( cursor ) for row in rows : pprint . pprint ( row ) print ( "({} rows from {})" . format ( len ( rows ) , dbname ) )