CompressionMethod

public enum CompressionMethod : String, CaseIterable, Codable, Sendable

Describes the compression method applied to record payloads in shard files.

  • gzip is the recommended method. It is implemented on top of zlib and is portable to every platform NyaruDB may target, including Android and Linux.
  • lzfse and lz4 use Apple’s Compression framework and are only available on Apple platforms. Using them ties the data files to Apple devices.

The method is stored in the record header flags (bits 1-3) and is also persisted in the collection manifest so that every shard file can be decompressed independently of external configuration.

  • No compression is applied. The payload is stored as-is.

    Declaration

    Swift

    case none
  • gzip compression (RFC 1952) via zlib. Portable to all platforms.

    Declaration

    Swift

    case gzip
  • Apple LZFSE compression. Apple platforms only.

    Declaration

    Swift

    case lzfse
  • lz4

    Apple LZ4 compression. Apple platforms only.

    Declaration

    Swift

    case lz4