MCPcopy Index your code
hub / github.com/BlueBash/BlogIQ / create_connection

Function create_connection

postgres.py:20–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18port = os.getenv("DB_PORT")
19
20def 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
29def close_connection(connection):
30 if connection:

Callers 2

create_recordFunction · 0.85
update_recordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected