Skip to main content

Module wal_codec

Module wal_codec 

Source
Expand description

Compact binary codec for WAL entries.

All records use the binary v1 format (version-prefixed + postcard serialisation of the variant fields). Legacy JSON is not supported.

§Wire format (v1)

[1 byte  version = 0x01]
[1 byte  variant discriminant]
[N bytes postcard-encoded variant fields]

Discriminants:

  • 0x00 → WalEntry::Write { point }
  • 0x01 → retired (was Delete; tombstones are catalog state)

Schema changes are not WAL entries: the catalog manifest is their durable record, and it is written before the data that needs them.

Enums§

CodecError
Errors produced by the WAL codec.

Functions§

decode
Decode a WAL payload into a WalEntry.
encode
Encode a WalEntry into the compact binary v1 format.
encode_write_point
Encode a single write-point directly without constructing a WalEntry.