Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions postgresql-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions test/postgres.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand All @@ -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$()

Expand All @@ -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)

Expand Down