We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 389d5d8 commit bd86514Copy full SHA for bd86514
test/transactions.js
@@ -27,4 +27,17 @@ describe('transactions', () => {
27
await client.query('ALTER TABLE foobar ADD COLUMN name TEXT')
28
await client.end()
29
})
30
+
31
+ it.only('can execute multiple statements in a transaction if no data', async () => {
32
+ const client = new pg.Client()
33
+ await client.connect()
34
+ await client.query('begin')
35
+ // create a cursor that has no data response
36
+ const createText = 'CREATE TEMP TABLE foobar(id SERIAL PRIMARY KEY)'
37
+ const cursor = client.query(new Cursor(createText))
38
+ const err = await new Promise(resolve => cursor.read(100, resolve))
39
+ assert.ifError(err)
40
+ await client.query('ALTER TABLE foobar ADD COLUMN name TEXT')
41
+ await client.end()
42
+ })
43
0 commit comments