Jido.Ecto.Storage (Jido Ecto v1.0.0)

Copy Markdown View Source

Ecto-backed Jido.Storage adapter.

The adapter persists three logical records:

  • checkpoints in jido_checkpoints
  • thread state snapshots in jido_threads
  • ordered thread journal entries in jido_thread_entries

Create those tables with Jido.Ecto.Migrations.create_storage_tables/1.

Required options:

Optional repo options passed through to queries:

  • :prefix
  • :timeout
  • :log
  • :telemetry_event
  • :telemetry_options

append_thread/3 also accepts:

  • :expected_rev - optimistic concurrency guard
  • :metadata - thread metadata used only when the thread is first created

Summary

Types

thread_state()

@type thread_state() :: %{
  rev: non_neg_integer(),
  created_at_ms: integer(),
  updated_at_ms: integer(),
  persisted?: boolean(),
  metadata: map(),
  entries: [Jido.Thread.Entry.t()]
}