Skip to content

Commit 264801e

Browse files
committed
Rebranded to "KurrentDB".
1 parent 57f58c0 commit 264801e

File tree

17 files changed

+138
-163
lines changed

17 files changed

+138
-163
lines changed

.github/workflows/github-actions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14-
eventstore-docker-image:
14+
docker-image:
1515
- docker.eventstore.com/eventstore-ce/eventstoredb-ce:22.10.4-jammy
1616
- docker.eventstore.com/eventstore-ce/eventstoredb-oss:23.10.2-jammy
1717
- docker.eventstore.com/eventstore/eventstoredb-ee:24.10.0-x64-8.0-bookworm-slim
1818
- docker.eventstore.com/kurrent-latest/kurrentdb:25.0.0-x64-8.0-bookworm-slim
1919
env:
20-
EVENTSTORE_DOCKER_IMAGE: ${{ matrix.eventstore-docker-image }}
20+
DOCKER_IMAGE: ${{ matrix.docker-image }}
2121
runs-on: "ubuntu-22.04"
2222
steps:
2323
- uses: actions/checkout@v3
@@ -28,8 +28,8 @@ jobs:
2828
run: make install-poetry
2929
- name: Install packages
3030
run: make install
31-
- name: Start EventStoreDB
32-
run: make start-eventstoredb
31+
- name: Start KurrentDB
32+
run: make start-kurrentdb
3333
- name: Lint
3434
run: make lint
3535
- name: Test

Makefile

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.EXPORT_ALL_VARIABLES:
22

3-
# EVENTSTORE_DOCKER_IMAGE ?= eventstore/eventstore:23.10.0-bookworm-slim
4-
#EVENTSTORE_DOCKER_IMAGE ?= docker.eventstore.com/eventstore/eventstoredb-ee:24.10.0-x64-8.0-bookworm-slim
5-
EVENTSTORE_DOCKER_IMAGE ?= docker.eventstore.com/kurrent-latest/kurrentdb:25.0.0-x64-8.0-bookworm-slim
3+
# DOCKER_IMAGE ?= eventstore/eventstore:23.10.0-bookworm-slim
4+
#DOCKER_IMAGE ?= docker.eventstore.com/eventstore/eventstoredb-ee:24.10.0-x64-8.0-bookworm-slim
5+
DOCKER_IMAGE ?= docker.eventstore.com/kurrent-latest/kurrentdb:25.0.0-x64-8.0-bookworm-slim
66

77
PYTHONUNBUFFERED=1
88

@@ -80,55 +80,55 @@ build:
8080
publish:
8181
$(POETRY) publish
8282

83-
.PHONY: start-eventstoredb-insecure
84-
start-eventstoredb-insecure:
83+
.PHONY: start-kurrentdb-insecure
84+
start-kurrentdb-insecure:
8585
docker run -d -i -t -p 2113:2113 \
8686
--env "EVENTSTORE_ALLOW_UNKNOWN_OPTIONS=true" \
8787
--env "EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=localhost" \
8888
--env "EVENTSTORE_ADVERTISE_HOST_PORT_TO_CLIENT_AS=2113" \
8989
--env "EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2113" \
90-
--name my-eventstoredb-insecure \
91-
$(EVENTSTORE_DOCKER_IMAGE) \
90+
--name my-kurrentdb-insecure \
91+
$(DOCKER_IMAGE) \
9292
--insecure \
9393
--enable-atom-pub-over-http
9494

95-
.PHONY: start-eventstoredb-secure
96-
start-eventstoredb-secure:
95+
.PHONY: start-kurrentdb-secure
96+
start-kurrentdb-secure:
9797
docker run -d -i -t -p 2114:2113 \
9898
--env "HOME=/tmp" \
9999
--env "EVENTSTORE_ALLOW_UNKNOWN_OPTIONS=true" \
100100
--env "EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=localhost" \
101101
--env "EVENTSTORE_ADVERTISE_HOST_PORT_TO_CLIENT_AS=2114" \
102102
--env "EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2114" \
103-
--name my-eventstoredb-secure \
104-
$(EVENTSTORE_DOCKER_IMAGE) \
103+
--name my-kurrentdb-secure \
104+
$(DOCKER_IMAGE) \
105105
--dev
106106

107-
.PHONY: attach-eventstoredb-insecure
108-
attach-eventstoredb-insecure:
109-
docker exec -it my-eventstoredb-insecure /bin/bash
107+
.PHONY: attach-kurrentdb-insecure
108+
attach-kurrentdb-insecure:
109+
docker exec -it my-kurrentdb-insecure /bin/bash
110110

111-
.PHONY: attach-eventstoredb-secure
112-
attach-eventstoredb-secure:
113-
docker exec -it my-eventstoredb-secure /bin/bash
111+
.PHONY: attach-kurrentdb-secure
112+
attach-kurrentdb-secure:
113+
docker exec -it my-kurrentdb-secure /bin/bash
114114

115-
.PHONY: stop-eventstoredb-insecure
116-
stop-eventstoredb-insecure:
117-
docker stop my-eventstoredb-insecure
118-
docker rm my-eventstoredb-insecure
115+
.PHONY: stop-kurrentdb-insecure
116+
stop-kurrentdb-insecure:
117+
docker stop my-kurrentdb-insecure
118+
docker rm my-kurrentdb-insecure
119119

120-
.PHONY: stop-eventstoredb-secure
121-
stop-eventstoredb-secure:
122-
docker stop my-eventstoredb-secure
123-
docker rm my-eventstoredb-secure
120+
.PHONY: stop-kurrentdb-secure
121+
stop-kurrentdb-secure:
122+
docker stop my-kurrentdb-secure
123+
docker rm my-kurrentdb-secure
124124

125-
.PHONY: start-eventstoredb
126-
start-eventstoredb: start-eventstoredb-insecure start-eventstoredb-secure
125+
.PHONY: start-kurrentdb
126+
start-kurrentdb: start-kurrentdb-insecure start-kurrentdb-secure
127127
@echo "Waiting for containers to be healthy"
128-
@until docker ps | grep "my-eventstoredb" | grep -in "healthy" | wc -l | grep -in 2 > /dev/null; do printf "." && sleep 1; done; echo ""
128+
@until docker ps | grep "my-kurrentdb" | grep -in "healthy" | wc -l | grep -in 2 > /dev/null; do printf "." && sleep 1; done; echo ""
129129
@docker ps
130130
@sleep 15
131131

132132

133-
.PHONY: stop-eventstoredb
134-
stop-eventstoredb: stop-eventstoredb-insecure stop-eventstoredb-secure
133+
.PHONY: stop-kurrentdb
134+
stop-kurrentdb: stop-kurrentdb-insecure stop-kurrentdb-secure

README.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
Please note: following the rebranding of EventStoreDB to KurrentDB, this package has
2-
been rebranded as [`eventsourcing-kurrentdb`](https://pypi.org/project/eventsourcing-kurrentdb). Please
1+
Please note: following the rebranding of EventStoreDB to KurrentDB, this package is
2+
the rebranding of [`eventsourcing-eventstoredb`](https://pypi.org/project/eventsourcing-eventstoredb). Please
33
migrate your code to use the [`eventsourcing-kurrentdb`](https://pypi.org/project/eventsourcing-kurrentdb)
44
package when you are ready.
55

66
# Event Sourcing in Python with KurrentDB
77

88
This is an extension package for the Python [eventsourcing](https://github.com/pyeventsourcing/eventsourcing) library
9-
that provides a persistence module for [EventStoreDB and KurrentDB](https://www.kurrent.io).
9+
that provides a persistence module for [KurrentDB](https://www.kurrent.io).
1010
It uses the [kurrentdbclient](https://github.com/pyeventsourcing/kurrentdbclient)
11-
package to communicate with EventStoreDB and KurrentDB via the gRPC interface.
11+
package to communicate with KurrentDB via the gRPC interface.
1212

1313
## Installation
1414

15-
Use pip to install the [stable distribution](https://pypi.org/project/eventsourcing-eventstoredb/)
15+
Use pip to install the [stable distribution](https://pypi.org/project/eventsourcing-kurrentdb/)
1616
from the Python Package Index.
1717

18-
$ pip install eventsourcing-eventstoredb
18+
$ pip install eventsourcing-kurrentdb
1919

2020
Please note, it is recommended to install Python packages into a Python virtual environment.
2121

2222
## Getting started
2323

2424
Define aggregates and applications in the usual way. Please note, "streams"
25-
in EventStoreDB and KurrentDB are constrained to start from position `0`, and this
25+
in KurrentDB are constrained to start from position `0`, and this
2626
package expects the `originator_version` of the first event in an aggregate sequence
2727
to be `0`, so you must set `INITIAL_VERSION` on your aggregate classes to `0`.
2828

@@ -58,7 +58,7 @@ class TrainingSchool(Application):
5858

5959

6060
class Dog(Aggregate):
61-
INITIAL_VERSION = 0 # for EventStoreDB and KurrentDB
61+
INITIAL_VERSION = 0 # for KurrentDB
6262

6363
@staticmethod
6464
def create_id(name: str):
@@ -79,43 +79,43 @@ class DogDetails(TypedDict):
7979
tricks: Tuple[str, ...]
8080
```
8181

82-
Configure the `TrainingSchool` application to use EventStoreDB or KurrentDB by setting
83-
the environment variable `PERSISTENCE_MODULE` to `'eventsourcing_eventstoredb'`. You
82+
Configure the `TrainingSchool` application to use KurrentDB by setting
83+
the environment variable `PERSISTENCE_MODULE` to `'eventsourcing_kurrentdb'`. You
8484
can do this in actual environment variables, or by passing in an `env` argument when
8585
constructing the application object, or by setting `env` on the application class.
8686

8787
```python
8888
import os
8989

90-
os.environ['TRAININGSCHOOL_PERSISTENCE_MODULE'] = 'eventsourcing_eventstoredb'
90+
os.environ['TRAININGSCHOOL_PERSISTENCE_MODULE'] = 'eventsourcing_kurrentdb'
9191
```
9292

93-
Also set environment variable `EVENTSTOREDB_URI` to an EventStoreDB
94-
or KurrentDB connection string URI. This value will be used as the `uri`
95-
argument when the `KurrentDBClient` class is constructed by this package.
93+
Also set environment variable `KURRENTDB_URI` to an KurrentDB connection
94+
string URI. This value will be used as the `uri` argument when the `KurrentDBClient`
95+
class is constructed by this package.
9696

9797
```python
98-
os.environ['EVENTSTOREDB_URI'] = 'esdb://localhost:2113?Tls=false'
98+
os.environ['KURRENTDB_URI'] = 'esdb://localhost:2113?Tls=false'
9999
```
100100

101-
If you are connecting to a "secure" EventStoreDB or KurrentDB server, unless
101+
If you are connecting to a "secure" KurrentDB server, unless
102102
the root certificate of the certificate authority used to generate the
103103
server's certificate is installed locally, then also set environment
104-
variable `EVENTSTOREDB_ROOT_CERTIFICATES` to an SSL/TLS certificate
105-
suitable for making a secure gRPC connection to the EventStoreDB server(s).
104+
variable `KURRENTDB_ROOT_CERTIFICATES` to an SSL/TLS certificate
105+
suitable for making a secure gRPC connection to the KurrentDB server(s).
106106
This value will be used as the `root_certificates` argument when the
107107
`KurrentDBClient` class is constructed by this package.
108108

109109

110110
```python
111-
os.environ['EVENTSTOREDB_ROOT_CERTIFICATES'] = '<PEM encoded SSL/TLS root certificates>'
111+
os.environ['KURRENTDB_ROOT_CERTIFICATES'] = '<PEM encoded SSL/TLS root certificates>'
112112
```
113113

114114
Please refer to the [kurrentdbclient](https://github.com/pyeventsourcing/kurrentdbclient)
115-
documentation for details about starting a "secure" or "insecure" EventStoreDB
116-
server, and the "esdb" and "esdb+discover" EventStoreDB connection string
115+
documentation for details about starting a "secure" or "insecure" KurrentDB
116+
server, and the "kdb" and "kdb+discover" KurrentDB connection string
117117
URI schemes, and how to obtain a suitable SSL/TLS certificate for use
118-
in the client when connecting to a "secure" EventStoreDB server.
118+
in the client when connecting to a "secure" KurrentDB server.
119119

120120
Construct the application.
121121

@@ -357,10 +357,6 @@ from the [Python website](https://www.python.org/downloads/).
357357
Once project dependencies have been installed, you should be able to run tests
358358
from within PyCharm (right-click on the `tests` folder and select the 'Run' option).
359359

360-
Because of a conflict between pytest and PyCharm's debugger and the coverage tool,
361-
you may need to add ``--no-cov`` as an option to the test runner template. Alternatively,
362-
just use the Python Standard Library's ``unittest`` module.
363-
364360
You should also be able to open a terminal window in PyCharm, and run the project's
365361
Makefile commands from the command line (see below).
366362

@@ -387,17 +383,17 @@ and creating the Poetry virtual environment using PyCharm (see above).
387383

388384
### Project Makefile commands
389385

390-
You can start EventStoreDB using the following command.
386+
You can start KurrentDB using the following command.
391387

392-
$ make start-eventstoredb
388+
$ make start-kurrentdb
393389

394-
You can run tests using the following command (needs EventStoreDB to be running).
390+
You can run tests using the following command (needs KurrentDB to be running).
395391

396392
$ make test
397393

398-
You can stop EventStoreDB using the following command.
394+
You can stop KurrentDB using the following command.
399395

400-
$ make stop-eventstoredb
396+
$ make stop-kurrentdb
401397

402398
You can check the formatting of the code using the following command.
403399

@@ -407,7 +403,7 @@ You can reformat the code using the following command.
407403

408404
$ make fmt
409405

410-
Tests belong in `./tests`. Code-under-test belongs in `./eventsourcing_eventstoredb`.
406+
Tests belong in `./tests`. Code-under-test belongs in `./eventsourcing_kurrentdb`.
411407

412408
Edit package dependencies in `pyproject.toml`. Update `poetry.lock` and installed packages
413409
using the following command.

eventsourcing_eventstoredb/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .factory import KurrentDBFactory
2+
3+
__all__ = ["KurrentDBFactory"]
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,47 +12,47 @@
1212
)
1313
from kurrentdbclient import KurrentDBClient
1414

15-
from eventsourcing_eventstoredb.recorders import (
16-
EventStoreDBAggregateRecorder,
17-
EventStoreDBApplicationRecorder,
15+
from eventsourcing_kurrentdb.recorders import (
16+
KurrentDBAggregateRecorder,
17+
KurrentDBApplicationRecorder,
1818
)
1919

2020
if TYPE_CHECKING:
2121
from eventsourcing.utils import Environment
2222

2323

24-
class EventStoreDBFactory(InfrastructureFactory[TrackingRecorder]):
24+
class KurrentDBFactory(InfrastructureFactory[TrackingRecorder]):
2525
"""
26-
Infrastructure factory for EventStoreDB infrastructure.
26+
Infrastructure factory for KurrentDB infrastructure.
2727
"""
2828

29-
EVENTSTOREDB_URI = "EVENTSTOREDB_URI"
30-
EVENTSTOREDB_ROOT_CERTIFICATES = "EVENTSTOREDB_ROOT_CERTIFICATES"
29+
KURRENTDB_URI = "KURRENTDB_URI"
30+
KURRENTDB_ROOT_CERTIFICATES = "KURRENTDB_ROOT_CERTIFICATES"
3131

3232
def __init__(self, env: Environment):
3333
super().__init__(env)
34-
eventstoredb_uri = self.env.get(self.EVENTSTOREDB_URI)
34+
eventstoredb_uri = self.env.get(self.KURRENTDB_URI)
3535
if eventstoredb_uri is None:
3636
msg = (
37-
f"{self.EVENTSTOREDB_URI!r} not found "
37+
f"{self.KURRENTDB_URI!r} not found "
3838
"in environment with keys: "
39-
f"{', '.join(self.env.create_keys(self.EVENTSTOREDB_URI))!r}"
39+
f"{', '.join(self.env.create_keys(self.KURRENTDB_URI))!r}"
4040
)
4141
raise InfrastructureFactoryError(msg)
42-
root_certificates = self.env.get(self.EVENTSTOREDB_ROOT_CERTIFICATES)
42+
root_certificates = self.env.get(self.KURRENTDB_ROOT_CERTIFICATES)
4343
self.client = KurrentDBClient(
4444
uri=eventstoredb_uri,
4545
root_certificates=root_certificates,
4646
)
4747

4848
def aggregate_recorder(self, purpose: str = "events") -> AggregateRecorder:
49-
return EventStoreDBAggregateRecorder(
49+
return KurrentDBAggregateRecorder(
5050
client=self.client,
5151
for_snapshotting=bool(purpose == "snapshots"),
5252
)
5353

5454
def application_recorder(self) -> ApplicationRecorder:
55-
return EventStoreDBApplicationRecorder(self.client)
55+
return KurrentDBApplicationRecorder(self.client)
5656

5757
def tracking_recorder(
5858
self, tracking_recorder_class: type[TrackingRecorder] | None = None
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from collections.abc import Sequence
3030

3131

32-
class EventStoreDBAggregateRecorder(AggregateRecorder):
32+
class KurrentDBAggregateRecorder(AggregateRecorder):
3333
SNAPSHOT_STREAM_PREFIX = "snapshot-$"
3434

3535
def __init__(
@@ -74,9 +74,7 @@ def _insert_events( # noqa: C901
7474
if len(set_of_originator_ids) == 0:
7575
return []
7676
if len(set_of_originator_ids) > 1:
77-
msg = (
78-
"EventStoreDB can't atomically store events in more than one stream"
79-
)
77+
msg = "KurrentDB can't atomically store events in more than one stream"
8078
raise ProgrammingError(msg)
8179

8280
# Make sure stored events have a gapless sequence of originator_versions.
@@ -227,9 +225,7 @@ def _construct_notification(recorded_event: RecordedEvent) -> Notification:
227225
)
228226

229227

230-
class EventStoreDBApplicationRecorder(
231-
EventStoreDBAggregateRecorder, ApplicationRecorder
232-
):
228+
class KurrentDBApplicationRecorder(KurrentDBAggregateRecorder, ApplicationRecorder):
233229
def insert_events(
234230
self, stored_events: list[StoredEvent], **kwargs: Any
235231
) -> Sequence[int] | None:
@@ -288,13 +284,13 @@ def max_notification_id(self) -> int | None:
288284
def subscribe(
289285
self, gt: int | None = None, topics: Sequence[str] = ()
290286
) -> Subscription[ApplicationRecorder]:
291-
return EventStoreDBSubscription(recorder=self, gt=gt, topics=topics)
287+
return KurrentDBSubscription(recorder=self, gt=gt, topics=topics)
292288

293289

294-
class EventStoreDBSubscription(Subscription[EventStoreDBApplicationRecorder]):
290+
class KurrentDBSubscription(Subscription[KurrentDBApplicationRecorder]):
295291
def __init__(
296292
self,
297-
recorder: EventStoreDBApplicationRecorder,
293+
recorder: KurrentDBApplicationRecorder,
298294
gt: int | None = None,
299295
topics: Sequence[str] = (),
300296
):

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[mypy]
22
python_version = 3.9
3-
files = eventsourcing_eventstoredb,tests
3+
files = eventsourcing_kurrentdb,tests
44

55
check_untyped_defs = True
66
disallow_any_generics = True

0 commit comments

Comments
 (0)