Skip to content

Serializing time event types from Dry::Struct events #1457

Answered by mostlyobvious
xhs345 asked this question in Q&A
Discussion options

You must be logged in to vote

The reason why you're seeing YAML in event data column in event_store_events tables is that we chose it as a safe default to serialize various data types. Mostly working without any additional configuration and supporting all database engines RES works on (not only PostgreSQL). Like every choice, it has its drawbacks too. YAML is one side of the spectrum.

This is the line responsible to set it:

repository: RailsEventStoreActiveRecord::EventRepository.new(serializer: RubyEventStore::Serializers::YAML),

In ecommerce app, which runs on PostgreSQL, we chose to store data column with jsonb d…

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by xhs345
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xhs345
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants