Skip to content

Commit

Permalink
Bugfix - Fix conn details for clearing events
Browse files Browse the repository at this point in the history
  • Loading branch information
subhashb committed Feb 23, 2022
1 parent f858451 commit 95ff075
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
40 changes: 30 additions & 10 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,37 @@ Release History
DEV
---

* Output VO values as nested dicts instead of a forced flat structure.
* Enclose DAOs within repositories to encourage DB interaction solely through repos.
* Cache registry, repositories, daos, and models with `@cache`.
* Fix sorting issue with null values in Memory DB.
* Add `any` filter and allow scalar values to `in` operator in Memory DB.
* Remove `remove` method from repository to discourage hard deletes.
* Add MessageDB Event store adapter.
* Introduce EventSourced Aggregates and Event Handlers.
* Introduce EventSourced Repositories.
* Wrap EventHandler execution within UoWs.


0.9.1
-----

* Bugfix - Use Domain's EventStore connection details for clearing events after test runs

0.9.0
-----

* Output VO values as nested dicts instead of a forced flat structure
* Enclose DAOs within repositories to encourage DB interaction solely through repos
* Remove `remove` method from repository to discourage hard deletes
* Manage concurrency with Aggregate versions
* Add MessageDB Event store adapter
* Add stand-in Memory Event store
* Introduce EventSourced Aggregates and Event Handlers
* Introduce EventSourced Repositories
* Allow filtering of messages from their origin stream
* Allow Event Handlers to listen to other streams and ALL streams
* Allow Command Handler methods to handle any event
* Wrap EventHandler and CommandHandler methods execute within UnitOfWork
* Associate Commands and Events with streams (explicit and via Aggregates)
* Support processing events and commands in synchronous mode.
* Allow asynchronous command processing by submitting commands to domain
* Add `autoflake` to `pre-commit`
* Treat empty string value as None in Date and DateTime Fields
* Support inter-attribute dependencies in Option defaults
* Cache registry, repositories, daos, and models with `@cache`
* Fix sorting issue with null values in Memory DB
* Add `any` filter and allow scalar values to `in` operator in Memory DB

0.8.1
-----
Expand Down
13 changes: 9 additions & 4 deletions src/protean/adapters/event_store/message_db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, Dict, List
from urllib.parse import urlparse

import psycopg2

Expand Down Expand Up @@ -55,14 +56,18 @@ def _read_last_message(self, stream_name) -> Dict[str, Any]:
def _data_reset(self):
"""Utility function to empty messages, to be used only by test harness.
This method is designed to work only with the postgres instance run in the configured docker container:
Port is locked to 5433 and it is assumed that the default user does not have a password, both of which
This method is designed to work only with the postgres instance running in the configured docker container:
User is locked to `postgres` and it is assumed that the default user does not have a password, both of which
should not be the configuration in production.
Any changes to docker configuration will need to updated here.
Any changes to configuration will need to updated here.
"""
parsed = urlparse(self.domain.config["EVENT_STORE"]["DATABASE_URI"])
conn = psycopg2.connect(
dbname="message_store", user="postgres", port=5433, host="localhost"
dbname=parsed.path[1:],
user="postgres",
port=parsed.port,
host=parsed.hostname,
)

cursor = conn.cursor()
Expand Down

0 comments on commit 95ff075

Please sign in to comment.