()
| 18 | port = os.getenv("DB_PORT") |
| 19 | |
| 20 | def create_connection(): |
| 21 | try: |
| 22 | connection = psycopg2.connect(dbname=dbname, user=user, password=password, host=host, port=port) |
| 23 | cursor = connection.cursor() |
| 24 | return connection, cursor |
| 25 | except psycopg2.Error as error: |
| 26 | print("Error creating database connection:", error) |
| 27 | return None, None |
| 28 | |
| 29 | def close_connection(connection): |
| 30 | if connection: |
no outgoing calls
no test coverage detected