@wataruoguchi/emmett-event-store-kysely 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -12
- package/package.json +4 -9
package/README.md
CHANGED
|
@@ -20,15 +20,23 @@ npm install @wataruoguchi/emmett-event-store-kysely @event-driven-io/emmett kyse
|
|
|
20
20
|
|
|
21
21
|
### 1. Database Setup
|
|
22
22
|
|
|
23
|
-
Set up the required PostgreSQL tables using [our migration example](
|
|
23
|
+
Set up the required PostgreSQL tables using [our migration example](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/database/migrations/1758758113676_event_sourcing_migration_example.ts):
|
|
24
24
|
|
|
25
25
|
```typescript
|
|
26
26
|
import { Kysely } from "kysely";
|
|
27
27
|
|
|
28
28
|
// Required tables: messages, streams, subscriptions
|
|
29
|
-
// See docs/database-setup.md for details
|
|
29
|
+
// See https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/database-setup.md for details
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
A read model table expects to have the following columns:
|
|
33
|
+
|
|
34
|
+
- stream_id (uuid)
|
|
35
|
+
- last_stream_position (bigint)
|
|
36
|
+
- last_global_position (bigint)
|
|
37
|
+
- partition (text)
|
|
38
|
+
- snapshot (jsonb)
|
|
39
|
+
|
|
32
40
|
### 2. Create Event Store
|
|
33
41
|
|
|
34
42
|
```typescript
|
|
@@ -102,24 +110,24 @@ await runner.projectEvents("subscription-id", "cart-123", {
|
|
|
102
110
|
});
|
|
103
111
|
```
|
|
104
112
|
|
|
105
|
-
See [Snapshot Projections documentation](
|
|
113
|
+
See [Snapshot Projections documentation](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/snapshot-projections.md) for details.
|
|
106
114
|
|
|
107
115
|
## Documentation
|
|
108
116
|
|
|
109
|
-
📚 **[Complete Documentation](
|
|
117
|
+
📚 **[Complete Documentation](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/README.md)**
|
|
110
118
|
|
|
111
119
|
### Core Guides
|
|
112
120
|
|
|
113
|
-
- [Database Setup](
|
|
114
|
-
- [Event Store](
|
|
115
|
-
- [Snapshot Projections](
|
|
116
|
-
- [Event Consumer](
|
|
117
|
-
- [Projection Runner](
|
|
121
|
+
- [Database Setup](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/database-setup.md) - PostgreSQL schema and requirements
|
|
122
|
+
- [Event Store](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/event-store.md) - Core event store API
|
|
123
|
+
- [Snapshot Projections](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/snapshot-projections.md) - Build read models (recommended) ⭐
|
|
124
|
+
- [Event Consumer](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/consumer.md) - Continuous background processing
|
|
125
|
+
- [Projection Runner](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/docs/projection-runner.md) - On-demand processing for tests
|
|
118
126
|
|
|
119
127
|
### Examples
|
|
120
128
|
|
|
121
|
-
- [Working Example](
|
|
122
|
-
- [Migration Example](
|
|
129
|
+
- [Working Example](https://github.com/wataruoguchi/emmett-event-store-kysely/tree/main/example/) - Complete application with carts and generators
|
|
130
|
+
- [Migration Example](https://github.com/wataruoguchi/emmett-event-store-kysely/blob/main/package/database/migrations/1758758113676_event_sourcing_migration_example.ts) - Database setup
|
|
123
131
|
|
|
124
132
|
## License
|
|
125
133
|
|
|
@@ -127,4 +135,4 @@ MIT
|
|
|
127
135
|
|
|
128
136
|
## Contributing
|
|
129
137
|
|
|
130
|
-
Contributions are welcome! Please see our [GitHub repository](https://github.com/wataruoguchi/
|
|
138
|
+
Contributions are welcome! Please see our [GitHub repository](https://github.com/wataruoguchi/emmett-event-store-kysely) for issues and PRs.
|
package/package.json
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.1",
|
|
7
7
|
"description": "Emmett Event Store with Kysely",
|
|
8
8
|
"author": "Wataru Oguchi",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/wataruoguchi/
|
|
12
|
+
"url": "https://github.com/wataruoguchi/emmett-event-store-kysely.git"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://github.com/wataruoguchi/
|
|
15
|
-
"bugs": "https://github.com/wataruoguchi/
|
|
14
|
+
"homepage": "https://github.com/wataruoguchi/emmett-event-store-kysely",
|
|
15
|
+
"bugs": "https://github.com/wataruoguchi/emmett-event-store-kysely/issues",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"module": "dist/index.js",
|
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"import": "./dist/index.js",
|
|
27
27
|
"require": "./dist/index.cjs"
|
|
28
|
-
},
|
|
29
|
-
"./projections": {
|
|
30
|
-
"types": "./dist/projections/index.d.ts",
|
|
31
|
-
"import": "./dist/projections/index.js",
|
|
32
|
-
"require": "./dist/projections/index.cjs"
|
|
33
28
|
}
|
|
34
29
|
},
|
|
35
30
|
"scripts": {
|