async function getMeta (key, {noDefault} = {noDefault: false}) {
  // massage inputs
  var keyStr = typeof key !== 'string' ? datEncoding.toStr(key) : key
  var origKeyStr = keyStr

  // validate inputs
  if (!HYPERDRIVE_HASH_REGEX.test(keyStr)) {
    try {
      keyStr = await hyperDns.resolveName(keyStr)
    } catch (e) {
      return noDefault ? undefined : defaultMeta(keyStr, origKeyStr)
    }
  }

  // fetch
  var meta = await db.get(`
    SELECT
        archives_meta.*,
        dat_dns.name as dnsName
      FROM archives_meta
      LEFT JOIN dat_dns ON dat_dns.key = archives_meta.key AND dat_dns.isCurrent = 1
      WHERE archives_meta.key = ?
      GROUP BY archives_meta.key
  `, [keyStr])
  if (!meta) {
    return noDefault ? undefined : defaultMeta(keyStr, origKeyStr)
  }

  // massage some values
  meta.url = `hyper://${meta.dnsName || meta.key}/`
  delete meta.dnsName
  meta.writable = !!meta.isOwner
  meta.memberOf = meta.memberOf || undefined

  // remove old attrs
  delete meta.isOwner
  delete meta.createdByTitle
  delete meta.createdByUrl
  delete meta.metaSize
  delete meta.stagingSize
  delete meta.stagingSizeLessIgnored

  return meta
}
@description
Get a single archive's metadata.
Returns an empty object on not-found.
@param {string | Buffer} key
@param {Object} [opts]
@param {boolean} [opts.noDefault]
@returns {Promise<LibraryArchiveMeta>}