code: def select_each(conn, query: str, parameter_groups, name=None):
      
  
      with conn:
          with conn.cursor(name=name) as cursor:
              for parameters in parameter_groups:
                  cursor.execute(query, parameters)
                  yield cursor.fetchone()
docs: Run select query for each parameter set in single transaction.