SerializationFormat

public enum SerializationFormat : String, CaseIterable, Codable, Sendable

Specifies the wire format used to serialize and deserialize documents.

NyaruDB supports two formats:

  • .json: Standard JSON, produced and consumed by JSONEncoder/JSONDecoder.
  • .msgpack: MessagePack, a compact binary format, produced and consumed by MsgPackEncoder/MsgPackDecoder from the SwiftMsgpack package.

The format is stored in the collection manifest and is immutable after collection creation — changing it would make existing records unreadable.

  • JavaScript Object Notation (JSON).

    Declaration

    Swift

    case json
  • MessagePack binary format.

    Declaration

    Swift

    case msgpack