createWriteStream = async (filename, created = new Date()) => {
  const fileStream = await createAtomicWriteStream(filename)
  const databaseFileType = getDatabaseFileType()

  return compose(
    createStringifyEntry(databaseFileType, created),
    createGzip(),
    fileStream,
    new Transform({
      flush(cb) {
        log.debug(`Database written to ${filename}`)
        cb()
      }
    })
  )
}
@param {string} filename
@param {Date} [created]
@returns {Promise<Transform[]>}