{"id":18510761,"url":"https://github.com/envato/event_sourcery-postgres","last_synced_at":"2025-12-28T16:46:21.983Z","repository":{"id":21902239,"uuid":"91394049","full_name":"envato/event_sourcery-postgres","owner":"envato","description":"Postgres event store implementation for EventSourcery","archived":false,"fork":false,"pushed_at":"2024-02-22T00:25:06.000Z","size":264,"stargazers_count":13,"open_issues_count":4,"forks_count":7,"subscribers_count":72,"default_branch":"main","last_synced_at":"2025-07-30T14:02:43.444Z","etag":null,"topics":["cqrs","domain-driven-design","event-sourcery","event-sourcing","postgres"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/envato.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-15T23:39:40.000Z","updated_at":"2023-01-14T09:22:36.000Z","dependencies_parsed_at":"2025-04-09T21:35:07.788Z","dependency_job_id":"47eaa7a8-4a8a-4173-801b-5e1a50c4c36e","html_url":"https://github.com/envato/event_sourcery-postgres","commit_stats":{"total_commits":192,"total_committers":17,"mean_commits":"11.294117647058824","dds":0.671875,"last_synced_commit":"82b74a371bc875dede715540b97f07a5507d3fcb"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/envato/event_sourcery-postgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fevent_sourcery-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fevent_sourcery-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fevent_sourcery-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fevent_sourcery-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envato","download_url":"https://codeload.github.com/envato/event_sourcery-postgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fevent_sourcery-postgres/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268350994,"owners_count":24236328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cqrs","domain-driven-design","event-sourcery","event-sourcing","postgres"],"created_at":"2024-11-06T15:24:55.839Z","updated_at":"2025-12-28T16:46:21.978Z","avatar_url":"https://github.com/envato.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EventSourcery::Postgres\n\n[![Build Status](https://github.com/envato/event_sourcery-postgres/actions/workflows/test.yml/badge.svg)](https://github.com/envato/event_sourcery-postgres/actions/workflows/test.yml)\n\n## Development Status\n\nEventSourcery is currently being used in production by multiple apps but we\nhaven't finalized the API yet and things are still moving rapidly. Until we\nrelease a 1.0 things may change without first being deprecated.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'event_sourcery-postgres'\n```\n\n## Configure\n\n```ruby\nEventSourcery::Postgres.configure do |config|\n  config.event_store_database = Sequel.connect(...)\n  config.projections_database = Sequel.connect(...)\n  config.write_events_function_name = 'writeEvents'\n  config.events_table_name = :events\n  config.aggregates_table_name = :aggregates\n  config.callback_interval_if_no_new_events = 60\nend\n```\n\n## Usage\n\n\n### Event Store\n\n```ruby\nItemAdded = EventSourcery::Event\n\nEventSourcery::Postgres.event_store.sink(ItemAdded.new(aggregate_id: uuid, body: { }}))\nEventSourcery::Postgres.event_store.get_next_from(0).each do |event|\n  puts event.inspect\nend\n```\n\n### Projectors \u0026 Reactors\n\n```ruby\nclass ItemProjector\n  include EventSourcery::Postgres::Projector\n\n  table :items do\n    column :item_uuid, 'UUID NOT NULL'\n    column :title, 'VARCHAR(255) NOT NULL'\n  end\n\n  project ItemAdded do |event|\n    table(:items).insert(item_uuid: event.aggregate_id,\n                         title: event.body.fetch('title'))\n  end\nend\n\nclass UserEmailer\n  include EventSourcery::Postgres::Reactor\n\n  emits_events SignUpEmailSent\n\n  process UserSignedUp do |event|\n    emit_event SignUpEmailSent.new(user_id: event.aggregate_id) do\n      UserMailer.signed_up(...).deliver\n    end\n  end\nend\n\nEventSourcery::EventProcessing::ESPRunner.new(\n  event_processors: [item_projector, user_emailer],\n  event_store:      EventSourcery::Postgres.config.event_store,\n  stop_on_failure:  true,\n).start!\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. (This will install dependencies and recreate the test database.) Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\nTo release a new version:\n\n1. Update the version number in `lib/event_sourcery/postgres/version.rb`\n2. Get this change onto main via the normal PR process\n3. Run `bundle exec rake release`, this will create a git tag for the\n   version, push tags up to GitHub, and upload the gem to rubygems.org.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/envato/event_sourcery-postgres.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvato%2Fevent_sourcery-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvato%2Fevent_sourcery-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvato%2Fevent_sourcery-postgres/lists"}