]>
Commit | Line | Data |
---|---|---|
e5424f29 MR |
1 | import psycopg2 |
2 | from base import Base | |
3 | ||
4 | class Postgres(Base): | |
5 | def __init__(self, database, user, password, host, port): | |
6 | if port is None: | |
7 | port = 5432 | |
8 | try: | |
fc01a3eb | 9 | self.conn = psycopg2.connect("dbname={0} user={1} password={2} host={3} port={4}".format(database, user, password, host, port)) |
e5424f29 MR |
10 | except psycopg2.Error as e: |
11 | raise Exception(e) |