diff --git a/package.json b/package.json index 1c7ead5..fcc9b27 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "coveralls": "3.1.x", "docco": "0.9.x", "seneca": "3.30.0", - "seneca-entity": "20.0.1", + "seneca-entity": "22.0.0", "seneca-store-test": "5.2.0" } } diff --git a/postgresql-store.js b/postgresql-store.js index 8e9088d..dff556e 100644 --- a/postgresql-store.js +++ b/postgresql-store.js @@ -173,14 +173,14 @@ function postgres_store(options) { - seneca.add('sys:entity,transaction:begin', function(msg,reply) { - // NOTE: `BEGIN` is called in intern.withDbClient + seneca.add('sys:entity,transaction:transaction', function(msg,reply) { + // NOTE: `transaction` is called in intern.withDbClient reply({ get_handle: () => ({ id: this.util.Nid(), name: 'postgres' }) }) }) - seneca.add('sys:entity,transaction:end', function(msg,reply) { + seneca.add('sys:entity,transaction:commit', function(msg,reply) { let transaction = msg.details() let client = transaction.client diff --git a/test/postgres.test.js b/test/postgres.test.js index 53705f5..e6dc67e 100644 --- a/test/postgres.test.js +++ b/test/postgres.test.js @@ -166,9 +166,9 @@ describe('seneca postgres plugin', () => { afterEach(clearDb(si)) it('happy', async () => { - let s0 = await si.entity.begin() + let s0 = await si.entity.transaction() await s0.entity('foo').data$({p1:'t1'}).save$() - let tx0 = await s0.entity.end() + let tx0 = await s0.entity.commit() expect(tx0).include({ handle: { name: 'postgres' }, @@ -184,7 +184,7 @@ describe('seneca postgres plugin', () => { it('rollback', async () => { - let s0 = await si.entity.begin() + let s0 = await si.entity.transaction() await s0.entity('foo').data$({p1:'t1'}).save$() @@ -210,7 +210,7 @@ describe('seneca postgres plugin', () => { return {ok:true} }) - let s0 = await si.entity.begin() + let s0 = await si.entity.transaction() // console.log(s0.entity)