Chronicle.Sinks.WellKnownSinkTypes (cratis_chronicle v1.0.2)

Copy Markdown View Source

Well-known sink type identifiers for Chronicle projections and reducers.

Use these atoms as the :default_sink_type_id option when starting Chronicle.Client. The default is :mongodb.

Available types

  • :mongodb — persists read models into MongoDB (default)
  • :sql — persists read models into a SQL database
  • :in_memory — persists read models in memory only
  • :not_set — no sink configured

Example

{Chronicle.Client,
  connection_string: "chronicle://localhost:35000?disableTls=true",
  event_store: "my-store",
  default_sink_type_id: :sql,
  read_models: [MyApp.ReadModels.Account]}

Summary

Functions

Sink type identifier for InMemory.

Sink type identifier for MongoDB.

Sink type identifier for NotSet (no sink).

Resolves an atom sink type name to its string identifier.

Sink type identifier for SQL.

Functions

in_memory()

@spec in_memory() :: String.t()

Sink type identifier for InMemory.

mongodb()

@spec mongodb() :: String.t()

Sink type identifier for MongoDB.

not_set()

@spec not_set() :: String.t()

Sink type identifier for NotSet (no sink).

resolve(value)

@spec resolve(atom() | String.t()) :: String.t()

Resolves an atom sink type name to its string identifier.

Accepts :mongodb, :sql, :in_memory, or :not_set. Raises ArgumentError for unknown values.

sql()

@spec sql() :: String.t()

Sink type identifier for SQL.