ops/ccs-ops-misc/load_test/common/db.py
def _execute(uri, query):
    """
    Execute a PSQL select statement and return its results
    """
    print('Collecting test data...')

    conn = None

    try:
        with psycopg2.connect(uri) as conn:
            with conn.cursor() as cursor:
                cursor.execute(query)
                results = cursor.fetchall()
                print(f'Returned {len(results)} results from the database for the test.')
    finally:
        conn.close()

    return results

    Execute a PSQL select statement and return its results
    
Execute a PSQL select statement and return its results
Execute a PSQL select statement and return its results
def _execute(uri, query):
    print('Collecting test data...')
    conn = None
    try:
        with psycopg2.connect(uri) as conn:
            with conn.cursor() as cursor:
                cursor.execute(query)
                results = cursor.fetchall()
                print(f'Returned {len(results)} results from the database for the test.')
    finally:
        conn.close()
    return results
def _execute ( uri , query ) : print ( 'Collecting test data...' ) conn = None try : with psycopg2 . connect ( uri ) as conn : with conn . cursor ( ) as cursor : cursor . execute ( query ) results = cursor . fetchall ( ) print ( f'Returned {len(results)} results from the database for the test.' ) finally : conn . close ( ) return results
Execute a PSQL select statement and return its results
Execute a PSQL select statement and return its results
"""
    Execute a PSQL select statement and return its results
    """
uri
query