Returns true if the blob with the given digest exists
        under the given table.
168078
def blob_exists(self, table, digest):
        
        response = self._request('HEAD', _blob_path(table, digest))
        if response.status == 200:
            return True
        elif response.status == 404:
            return False
        _raise_for_status(response)
348014
function exists(name, db) {
  return db(db.raw('information_schema.tables')).count('table_name').where('table_name', name).then(function (resp) {
    if (resp.length !== 1) {
      throw new Error('invalid response');
    }
    if (typeof resp[0].count !== 'number') {
      throw new Error('invalid response');
    }
    return resp[0].count;
  });
}
739708
def ensure_table(self, cls):
        """"""
        exists = True
        conn = get_conn()

        try:
            descrip = conn.describe_table(cls.get_table_name())
            assert descrip is not None
        except ResourceNotFoundException:
            # Expected - this is what we get if there is no table
            exists = False
        except JSONResponseError:
            # Also assuming no table
            exists = False

        if not exists:
            table = self.table_schema_call(Table.create, cls)
            assert table is not None
1164138
private TableName snapshotExists(String snapshotName,
      List<SnapshotDescription> snapshotDescriptions) {
    if (snapshotDescriptions != null) {
      Optional<SnapshotDescription> descriptor =
          snapshotDescriptions.stream()
              .filter(desc -> desc.getName().equals(snapshotName))
              .findFirst();
      return descriptor.isPresent() ? descriptor.get().getTableName() : null;
    }
    return null;
  }
45692
public boolean verifyDigest(int digestPos, byte[] handshakeMessage, byte[] key, int keyLen) {
        if (log.isTraceEnabled()) {
            log.trace("verifyDigest - digestPos: {} keyLen: {} handshake size: {} ", digestPos, keyLen, handshakeMessage.length);
        }
        byte[] calcDigest = new byte[DIGEST_LENGTH];
        calculateDigest(digestPos, handshakeMessage, 0, key, keyLen, calcDigest, 0);
        if (!Arrays.equals(Arrays.copyOfRange(handshakeMessage, digestPos, (digestPos + DIGEST_LENGTH)), calcDigest)) {
            return false;
        }
        return true;
    }
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
303051
public static boolean isSnapshotablePersistentTableView(Database db, Table table) {
        Table materializer = table.getMaterializer();
        if (materializer == null) {
            // Return false if it is not a materialized view.
            return false;
        }
        if (CatalogUtil.isTableExportOnly(db, materializer)) {
            // The view source table should not be a streamed table.
            return false;
        }
        if (! table.getIsreplicated() && table.getPartitioncolumn() == null) {
            // If the view table is implicitly partitioned (maybe was not in snapshot),
            // its maintenance is not turned off during the snapshot restore process.
            // Let it take care of its own data by itself.
            // Do not attempt to restore data for it.
            return false;
        }
        return true;
    }
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
722388
def table_exists(self, tablename: str) -> bool:
        """"""
        # information_schema is ANSI standard
        sql = """
            SELECT COUNT(*)
            FROM information_schema.tables
            WHERE table_name=?
            AND table_schema={}
        """.format(self.get_current_schema_expr())
        row = self.fetchone(sql, tablename)
        return True if row[0] >= 1 else False
1284509
public function table_exists( Table $table ) {

		$statement = new GenericStatement( "SHOW TABLES LIKE %s" );
		$result = $this->database
			->query_statement( $statement, [ (string) $table ] );

		if ( ! $result->valid() )
			return FALSE;

		/**
		 * @todo refactor this as soon as
		 * we have unified options bit-mask implemented
		 * to get results in single-level arrays
		 *
		 * return $result->contains( $table );
		 */

		$tables = [];
		foreach ( $result as $row ) {
			$tables = array_merge(
				$tables,
				array_values(
					get_object_vars( $row )
				)
			);
		}
		return in_array( $table, $tables );
	}
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]);
    }
654743
public static boolean queryIsEmpty(SQLiteDatabase db, String table) {
        long isEmpty = longForQuery(db, "select exists(select 1 from " + table + ")", null);
        return isEmpty == 0;
    }
1164422
def exists(table_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        conn.describe_table(table_name)
    except JSONResponseError as e:
        if e.error_code == 'ResourceNotFoundException':
            return False
        raise

    return True
154208
public boolean tableExists(String table)
		throws SQLException
	{

		PreparedStatement statement = null;
		ResultSet result = null;
		try {
			statement = this.connection.prepareStatement("SHOW TABLES;");
			result = execute(statement);

			if (result == null) {
				return false;
			}
			boolean found = false;
			while(result.next()){
					if(table.equalsIgnoreCase(result.getString(1))){
						found = true;
					}
			}
			return found;

		}
		finally {
			if (statement != null) {
				statement.close();
			}
			if (result != null) {
				result.close();
			}
		}

	}
1311857
def table_exists(self, table):
        
        if not self.dataset_exists(table.dataset):
            return False

        try:
            self.client.tables().get(projectId=table.project_id,
                                     datasetId=table.dataset_id,
                                     tableId=table.table_id).execute()
        except http.HttpError as ex:
            if ex.resp.status == 404:
                return False
            raise

        return True
963885
protected function _tableExists($table)
    {
        $db = ConnectionManager::get('default');
        $tables = $db->schemaCollection()->listTables();

        return in_array($table, $tables);
    }
457634
def blob_get(self, table, digest, chunk_size=1024 * 128):
        
        response = self._request('GET', _blob_path(table, digest), stream=True)
        if response.status == 404:
            raise DigestNotFoundException(table, digest)
        _raise_for_status(response)
        return response.stream(amt=chunk_size)