def get_db_connection():
"""
psycopg2 connection context manager.
Fetch a connection from the connection pool and release it.
"""
try:
connection = pool.getconn()
yield connection
finally:
pool.putconn(connection)
评论列表
文章目录