EventFlow
EventFlow copied to clipboard
Specific column "EventName"
All SQL implementations use serialized metadata to store the event name. While this is certainly enough to replay events, during development, I often need to look into the database to figure out what happened and it would be so much nicer if I was able to distinguish events by name.
- Benefits / performance impact / additional size?
- Could we add this "on demand", so people don't have to migrate existing data?
We have the same in the event source system that doesn't use EventFlow (created before EventFlow) and is indeed convenient.
As its merely a "display" field for when viewing, we could just add a default null column.
For MSSQL, I have a workaround where I use JSON_VALUE in a View - no need for duplicated data.
@frankebersoll this would be the most efficient way and would actually be a handy implementation to have on the existing schema structure with alternate database tech supplying their own view logic...eg MySQL would use JSON_EXTRACT.
The script for MSSQL could look like this:
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_schema = N'dbo' AND table_name = N'EventFlowView')
BEGIN
EXECUTE('CREATE VIEW [dbo].[EventFlowView]
AS SELECT
GlobalSequenceNumber,
AggregateName,
AggregateId,
AggregateSequenceNumber,
JSON_VALUE(Metadata, ''$.event_name'') as EventName,
JSON_VALUE(Metadata, ''$.timestamp'') as Timestamp,
Data
FROM EventFlow')
END
@rasmus Could we make this optional in EventFlowEventStoresMsSql.MigrateDatabase
?
Hello there!
We hope you are doing well. We noticed that this issue has not seen any activity in the past 90 days. We consider this issue to be stale and will be closing it within the next seven days.
If you still require assistance with this issue, please feel free to reopen it or create a new issue.
Thank you for your understanding and cooperation.
Best regards, EventFlow
Hello there!
This issue has been closed due to inactivity for seven days. If you believe this issue still needs attention, please feel free to open a new issue or comment on this one to request its reopening.
Thank you for your contribution to this repository.
Best regards, EventFlow