From bd86514c722e803321f4036d1e67139a695cf1bd Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Wed, 30 Oct 2019 11:43:17 -0500 Subject: [PATCH] Add another test --- test/transactions.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/transactions.js b/test/transactions.js index 75d32a4a..37af28c4 100644 --- a/test/transactions.js +++ b/test/transactions.js @@ -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() + }) })