Execute SQL and return results (convenience function)
(sql: str, params: tuple = None)
| 660 | |
| 661 | |
| 662 | def execute_sql(sql: str, params: tuple = None) -> List[Dict[str, Any]]: |
| 663 | """ |
| 664 | Execute SQL and return results (convenience function) |
| 665 | """ |
| 666 | with get_pg_connection() as conn: |
| 667 | cursor = conn.cursor() |
| 668 | cursor.execute(sql, params) |
| 669 | if sql.strip().upper().startswith('SELECT'): |
| 670 | return cursor.fetchall() |
| 671 | conn.commit() |
| 672 | return [] |
| 673 | |
| 674 | |
| 675 | def is_postgres_available() -> bool: |
nothing calls this directly
no test coverage detected