def connect(self, dsn):
        """Connect to DB.

        dbname: the database name user: user name used to authenticate password:
        password used to authenticate host: database host address (defaults to UNIX
        socket if not provided) port: connection port number (defaults to 5432 if not
        provided)

        """
        self.con = psycopg2.connect(dsn)
        self.cur = self.con.cursor(cursor_factory=psycopg2.extras.DictCursor)
        # autocommit: Disable automatic transactions
        self.con.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)