Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed events to messages in the PostgreSQL and SQLite schemas and added message kind column #184

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

oskardudycz
Copy link
Collaborator

@oskardudycz oskardudycz commented Feb 8, 2025

A follow-up to adding a general message structure in #183.

As we want to store not only events but in general messages, it'd be good to align table naming structure. This PR renames tables and columns to have event in their names instead of message (e.g., message ID, message type, etc.).

Thanks to that, Emmett will be able to store and then handle async workflows as described in https://event-driven.io/en/how_to_have_fun_with_typescript_and_workflow/. Commands will be stored either in the stream together with events or in a dedicated "outgoing commands stream".

This PR changes PostgreSQL and SQLite schema in a breaking manner:

  • emt_events is migrated into emt_messages (and related partitions tables),
  • emt_append_event function in PostgreSQL is renamed to emt_append_to_stream,
  • emt_global_event_position PostgreSQL sequence into emt_global_message_position

But:

  • For PostgreSQL automated migration was added,
  • For SQLite, there's no one, afaik, using it on prod yet, so no migration here.

@oskardudycz
Copy link
Collaborator Author

@davecosec FYI.

@oskardudycz oskardudycz modified the milestones: 0.27.0, 0.28.0 Feb 11, 2025
@oskardudycz oskardudycz force-pushed the renaming_events_to_messages_in_tables branch from 64a6603 to af905d6 Compare February 11, 2025 19:43
@oskardudycz oskardudycz modified the milestones: 0.28.0, 0.29.0, 0.30.0 Feb 12, 2025
Base automatically changed from message_type to main February 27, 2025 19:05
@oskardudycz oskardudycz force-pushed the renaming_events_to_messages_in_tables branch from af905d6 to 0f17e3a Compare February 27, 2025 19:22
@oskardudycz oskardudycz force-pushed the renaming_events_to_messages_in_tables branch from cbf759c to 2c42eec Compare February 27, 2025 19:46
@oskardudycz oskardudycz marked this pull request as ready for review February 27, 2025 19:58
@oskardudycz oskardudycz force-pushed the renaming_events_to_messages_in_tables branch from f8b58d7 to b603a9d Compare February 27, 2025 20:16
@oskardudycz oskardudycz added this to the 0.31.0 milestone Feb 27, 2025
@oskardudycz
Copy link
Collaborator Author

Okay, I'm pulling that in. I checked if the PostgreSQL migration would work on the sample project, and it did.

@oskardudycz oskardudycz force-pushed the renaming_events_to_messages_in_tables branch from b603a9d to a42af76 Compare February 27, 2025 20:28
@oskardudycz oskardudycz merged commit 78d30e1 into main Feb 27, 2025
4 checks passed
@oskardudycz oskardudycz deleted the renaming_events_to_messages_in_tables branch February 27, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant