mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
Add another test
This commit is contained in:
parent
389d5d8c14
commit
bd86514c72
@ -27,4 +27,17 @@ describe('transactions', () => {
|
||||
await client.query('ALTER TABLE foobar ADD COLUMN name TEXT')
|
||||
await client.end()
|
||||
})
|
||||
|
||||
it.only('can execute multiple statements in a transaction if no data', async () => {
|
||||
const client = new pg.Client()
|
||||
await client.connect()
|
||||
await client.query('begin')
|
||||
// create a cursor that has no data response
|
||||
const createText = 'CREATE TEMP TABLE foobar(id SERIAL PRIMARY KEY)'
|
||||
const cursor = client.query(new Cursor(createText))
|
||||
const err = await new Promise(resolve => cursor.read(100, resolve))
|
||||
assert.ifError(err)
|
||||
await client.query('ALTER TABLE foobar ADD COLUMN name TEXT')
|
||||
await client.end()
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user