(connection: Connection, query, parameters)
| 38 | |
| 39 | |
| 40 | async def execute_query(connection: Connection, query, parameters): |
| 41 | query_type = query.strip().split()[0].lower() |
| 42 | if query_type == 'select': |
| 43 | return await connection.fetch(query, *parameters) |
| 44 | |
| 45 | status = await connection.execute(query, *parameters) |
| 46 | # parse status string to update count (if any) as a result |
| 47 | status_parts = status.split() |
| 48 | if status_parts[0] == 'INSERT' or status_parts[0] == 'UPDATE': |
| 49 | row_count = int(status_parts[-1]) |
| 50 | return [{'count': row_count}] |
| 51 | |
| 52 | return None |
| 53 | |
| 54 | |
| 55 | async def execute_steps(steps, variables, connection): |
no test coverage detected
searching dependent graphs…