Returns `true` if PostgreSQL database table exists.
@todo Implement this in nor-pg and use here.
188684
function pg_table_exists(self, name) {
	return do_query(self, 'SELECT * FROM information_schema.tables WHERE table_name = $1 LIMIT 1', [name]).then(function(rows) {
		if(!rows) { throw new TypeError("Unexpected result from query: " + util.inspect(rows)); }
		return rows.length !== 0;
	});
}
654743
public static boolean queryIsEmpty(SQLiteDatabase db, String table) {
        long isEmpty = longForQuery(db, "select exists(select 1 from " + table + ")", null);
        return isEmpty == 0;
    }
1114956
public function table_exists($table) {
        if (is_string($table)) {
            $tablename = $table;
        } else {
            // Calculate the name of the table
            $tablename = $table->getName();
        }

        if ($this->temptables->is_temptable($tablename)) {
            return true;
        }

        // Get all tables in moodle database.
        $tables = $this->mdb->get_tables();
        return isset($tables[$tablename]);
    }
12718
def exists(self):
    
    try:
      info = self._api.tables_get(self._name_parts)
    except google.datalab.utils.RequestException as e:
      if e.status == 404:
        return False
      raise e
    except Exception as e:
      raise e
    self._info = info
    return True
1176192
public static boolean existsTable(String appid) {
		if (StringUtils.isBlank(appid)) {
			return false;
		}
		try {
			DescribeTableResult res = getClient().describeTable(getTableNameForAppid(appid));
			return res != null;
		} catch (Exception e) {
			return false;
		}
	}
1084340
def does_table_exist(self, connection):
        

        if '.' in self.table:
            query = ("select 1 as table_exists "
                     "from information_schema.tables "
                     "where table_schema = lower(%s) and table_name = lower(%s) limit 1")
        else:
            query = ("select 1 as table_exists "
                     "from pg_table_def "
                     "where tablename = lower(%s) limit 1")
        cursor = connection.cursor()
        try:
            cursor.execute(query, tuple(self.table.split('.')))
            result = cursor.fetchone()
            return bool(result)
        finally:
            cursor.close()
194730
public function tableExists($table_name,$which_connection='')
    {
        /**
          Check whether the definition is in cache
        */
        if (isset($this->structure_cache[$which_connection]) && isset($this->structure_cache[$which_connection][$table_name])) {
            return true;
        }

        $conn = $this->getNamedConnection($which_connection);
        if (!is_object($conn)) {
            return false;
        }
        $cols = $conn->MetaColumns($table_name);
        if ($cols === false) {
            return false;
        }

        return true;
    }
1327966
def db_exists(name, **client_args):
    '''
    
    '''
    if name in [db['name'] for db in list_dbs(**client_args)]:
        return True

    return False
385050
final public function existsInDb() {

		$class = get_called_class();
		$conds = implode(' AND ', $this->getSqlKeyConditions());

		$this->db->setQuery('SELECT COUNT(1) FROM `' . $class::TABLE_NAME . '` WHERE ' . $conds);
		
		return (bool)$this->db->loadCount($this->getId());
	
	}
313287
def _table_exists(self):
        """"""
        self.cursor.execute("SHOW TABLES")
        for table in self.cursor.fetchall():
            if table[0].lower() == self.name.lower():
                return True
        return False
462535
public static boolean doesTableExist(JdbcOperations jdbcOperations, final String table) {

        final boolean tableExists =
                jdbcOperations.execute(
                        new ConnectionCallback<Boolean>() {
                            @Override
                            public Boolean doInConnection(Connection con)
                                    throws SQLException, DataAccessException {

                                final DatabaseMetaData metaData = con.getMetaData();
                                final ResultSet tables =
                                        metaData.getTables(
                                                null, null, null, new String[] {"TABLE"});
                                while (tables.next()) {
                                    final String dbTableName = tables.getString("TABLE_NAME");
                                    if (table.equalsIgnoreCase(dbTableName)) {
                                        return true;
                                    }
                                }

                                return false;
                            }
                        });
        return tableExists;
    }
386068
public function exists()
    {
        $sql = $this->grammar->compileExists($this);

        $results = $this->connection->query($sql, $this->getBindings())->result();

        if (isset($results[0])) {
            $results = (array) $results[0];
            return (bool) $results['exists'];
        }
        return false;
    }
959719
def has_table(self, name):
        """"""
        return len(self.sql("SELECT name FROM sqlite_master WHERE type='table' AND name=?",
                            parameters=(name,), asrecarray=False, cache=False)) > 0
1370213
public function tableExists( $tablename )
	{
		$sql = "
			SELECT TABLE_NAME
			FROM INFORMATION_SCHEMA.TABLES
			WHERE TABLE_TYPE = 'BASE TABLE'
				AND TABLE_SCHEMA = ?
				AND TABLE_NAME = ?
		";

		$stmt = $this->_conn->create( $sql );
		$stmt->bind( 1, $this->_dbname );
		$stmt->bind( 2, $tablename );
		$result = $stmt->execute();

		if( $result->fetch() !== false ) {
			return true;
		}

		return false;
	}
1337706
public function isPostgres()
    {
        static $r;
        if (is_null($r)) {
            $r = $this->driver->getPlatformName() == self::POSTGRESQL_PLATFORM;
        }
        return $r;
    }
481815
private function hasDatabaseDriver()
    {
        if (!count($this->getDatabaseDrivers())) {
            $this->console->error(
                'At least 1 PDO driver is required. Either sqlite, mysql or pgsql, check your php.ini file'
            );
            $this->errors = true;
        }
        return false;
    }
763828
public function exists() : bool
    {
        $query = static::createQuery();
        $pks = static::getPrimaryKeys();
        $pkValues = $this->getPrimaryKeyValues();

        if (count($pks) != count($pkValues)) {
            return false;
        }

        $filterFunction = function (WhereClause $whereClause) use (&$pkValues, $query) {
            foreach ($pkValues as $field => $value) {
                $whereClause->and($field, '=', '?');
                $query->bind($value);
            }
        };
        $query->where($filterFunction)
            ->count('*');

        $row = $query->execute()->fetch();

        return $row['all_count'] > 0;
    }