Fact.Seam.EventSchema.Kurrent.V1 (Fact v0.3.1)
View SourceAn EventSchema similar to the schema used in the KurrentDB .NET client.
See the definition on GitHub
Differences
Kurrent event records do not support a field for event tags. By default __Tags__
is used, but this may be configured when the database is created.
$ mix fact.create --path tmp/kurrent-ish \
--event-schema kurrent@1 \
--event-schema-options event_tags=Tags
Additionally, Kurrent supports a ContentType field, which Fact does not support at this time.
Example
When using kurrent@1, persisted event records will take the following shape, with the caveat that
__Tags__ may differ if configured to something else.
{
"Data": {name: "Turts"},
"EventId": "3bb4808303c847fd9ceb0a1251ef95da",
"EventMetadata": {"correlationId": "240d3c0e-3251-4076-a769-97a6a705533e"},
"__Tags__": ["turtle:1"],
"EventType": "egg_hatched",
"Position": "2",
"Created": 1765039106962264,
"EventStreamId": "turtle-1",
"EventNumber": 1,
}
Summary
Functions
Gets the default options.
Gets a map of the keys used for Kurrent-like event records.
Gets the specification for the configuration options.
Types
@type t() :: %Fact.Seam.EventSchema.Kurrent.V1{event_tags: String.t()}
Configuration options for the Kurrent v1 event schema.
Functions
@spec default_options() :: t()
Gets the default options.
@spec get( t(), keyword() ) :: Fact.event_record_schema()
Gets a map of the keys used for Kurrent-like event records.
Gets the specification for the configuration options.