def connect(self):
        if not self.conn:
            conn = pgconnect(ADMIN_DB, self.user, self.host, self.port)
            curs = pgexecute(conn,
                             "SELECT 1 FROM pg_database WHERE datname = '%s'" %
                             self.name)
            row = curs.fetchone()
            if not row:
                curs.close()
                curs = pgexecute_auto(conn, CREATE_DDL % self.name)
                curs.close()
            conn.close()
            self.conn = pgconnect(self.name, self.user, self.host, self.port)
            curs = pgexecute(self.conn, "SHOW server_version_num")
            self._version = int(curs.fetchone()[0])
Checks whether the specified expected SQL queries match to those
dataset/ETHPy150Open perseas/Pyrseas/pyrseas/lib/dbutils.py/PostgresDb.connect--crossover with--dataset/ETHPy150Open lsaffre/lino/lino/utils/djangotest.py/DjangoManageTestCase.check_sql_queries