Skip to content

Commit

Permalink
Added support for DB Proxies (e.g. pgbouncer)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Jun 8, 2020
1 parent 7dfe1ac commit ffd4edf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/pgbouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def enabled() -> bool:

def connect_to_postgres() -> psycopg2:
con = psycopg2.connect(
host=os.getenv('PGBOUNCER_AUTH_QUERY_HOST'),
port=os.getenv('PGBOUNCER_AUTH_QUERY_POST', '5432'),
user=os.getenv('PGBOUNCER_AUTH_QUERY_USER'),
password=os.getenv('PGBOUNCER_AUTH_QUERY_PASSWORD'),
database=os.getenv('PGBOUNCER_AUTH_QUERY_DATABASE')
host=os.getenv('PGBOUNCER_AUTH_QUERY_DB_HOST'),
port=os.getenv('PGBOUNCER_AUTH_QUERY_DB_POST', '5432'),
user=os.getenv('PGBOUNCER_AUTH_QUERY_DB_USER'),
password=os.getenv('PGBOUNCER_AUTH_QUERY_DB_PASSWORD'),
database=os.getenv('PGBOUNCER_AUTH_QUERY_DB_NAME')
)

con.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
Expand Down

0 comments on commit ffd4edf

Please sign in to comment.