Skip to content

Instantly share code, notes, and snippets.

View jevy-wangfei's full-sized avatar
🎯
Focusing

Jevy jevy-wangfei

🎯
Focusing
View GitHub Profile
@jevy-wangfei
jevy-wangfei / postgres.py
Created August 24, 2021 05:17 — forked from goldsborough/postgres.py
Python psycopg2 wrapper
###########################################################################
#
## @file postgres.py
#
###########################################################################
import psycopg2
###########################################################################
#
@jevy-wangfei
jevy-wangfei / connectionpool.py
Created August 24, 2021 05:16 — forked from santosh/connectionpool.py
Connection pooling with PostgreSQL in Python.
from psycopg2.extras import DictCursor
from psycopg2.pool import SimpleConnectionPool
class Database:
__pool = None
@classmethod
def initialize(cls, **kwargs):
cls.__pool = SimpleConnectionPool(minconn=2,