MCPcopy Index your code
hub / github.com/dbcli/pgcli / close_cn

Function close_cn

tests/features/db_utils.py:75–83  ·  view source on GitHub ↗

Close connection. :param connection: psycopg2.connection

(cn=None)

Source from the content-addressed store, hash-verified

73
74
75def close_cn(cn=None):
76 """
77 Close connection.
78 :param connection: psycopg2.connection
79 """
80 if cn:
81 cn_params = cn.info.get_parameters()
82 cn.close()
83 print(f"Closed connection: {cn_params}.")

Callers 1

drop_dbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected