Gamend.LobbySnapshots.Blob (gamend_core v1.0.1192)

Copy Markdown View Source

Content-addressed storage for one snapshot section.

The hash is the primary key, so identical content stores a single row however many sections, snapshots or lobbies reference it. This subsumes per-section change detection: an unchanged section hashes to the value already stored.

last_referenced_at is what retention prunes on — see the migration for why inserted_at cannot be used for that.

Summary

Types

t()

@type t() :: %Gamend.LobbySnapshots.Blob{
  __meta__: term(),
  byte_size: term(),
  content: term(),
  hash: term(),
  inserted_at: term(),
  last_referenced_at: term()
}

Functions

changeset(blob, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()