Skip to content

Commit 918ae5e

Browse files
committed
Bug fix for persistence engine
1 parent b62ce8a commit 918ae5e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

lib/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ class PostgresPersistenceEngine extends AbstractPersistenceEngine {
7272
created_at,
7373
data,
7474
tags
75-
) VALUES ($1, $2, $3, $4, $5)
75+
) VALUES ($/key/, $/sequenceNumber/, $/createdAt/, $/data:json/, $/tags/)
7676
RETURNING ordering;
7777
`;
7878
return this.db.one(
79-
query, [
80-
persistedEvent.key,
81-
persistedEvent.sequenceNumber,
82-
persistedEvent.createdAt,
83-
persistedEvent.data,
84-
persistedEvent.tags
85-
]
79+
query, {
80+
key: persistedEvent.key,
81+
sequenceNumber: persistedEvent.sequenceNumber,
82+
createdAt: persistedEvent.createdAt,
83+
data: persistedEvent.data,
84+
tags: persistedEvent.tags
85+
}
8686
);
8787
}
8888

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nact-persistence-postgres",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "nact-persistence-postgres ⇒ nact + postresql = your services have never been so persistent",
55
"main": "lib/index.js",
66
"scripts": {

test/postgres-persistence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('PostgresPersistenceEngine', function () {
5454
const engine = new PostgresPersistenceEngine(connectionString);
5555
await retry(async () => {
5656
const event1 = new PersistedEvent({ message: 'hello' }, 1, 'test', ['a', 'b', 'c']);
57-
const event2 = new PersistedEvent({ message: 'goodbye' }, 2, 'test');
57+
const event2 = new PersistedEvent([ 'message', 'goodbye' ], 2, 'test');
5858
const event3 = new PersistedEvent({ message: 'hello' }, 1, 'test2');
5959
await engine.persist(event1);
6060
await engine.persist(event2);

0 commit comments

Comments
 (0)