]> git.datanom.net - pwp.git/blame - app/DB/postgres.py
initial commit
[pwp.git] / app / DB / postgres.py
CommitLineData
e5424f29
MR
1import psycopg2
2from base import Base
3
4class Postgres(Base):
5 def __init__(self, database, user, password, host, port):
6 if port is None:
7 port = 5432
8 try:
9 self.conn = psycopg2.connect("dbname=%s user=%s password=%s host=%s port=%d" % (database, user, password, host, port))
10 except psycopg2.Error as e:
11 raise Exception(e)
This page took 0.038043 seconds and 5 git commands to generate.