Skip to content

Conversation

@maxcbc
Copy link
Contributor

@maxcbc maxcbc commented Oct 2, 2025

TransactionSql is missing properties from Sql added in

postgres/src/index.js

Lines 69 to 82 in 32feb25

Object.assign(sql, {
get parameters() { return options.parameters },
largeObject: largeObject.bind(null, sql),
subscribe,
CLOSE,
END: CLOSE,
PostgresError,
options,
reserve,
listen,
begin,
close,
end
})
.

This PR updates the type definition of TransactionSql to reflect this.

This means typescript will now raise an error if consuming code tries the following:

sql.begin((trx) => {
   trx.begin((trx2) => {
       ...
   })
})

@porsager porsager force-pushed the master branch 2 times, most recently from 4a0fe34 to 3a43815 Compare November 12, 2025 04:40
@porsager porsager merged commit 36a53f6 into porsager:master Nov 12, 2025
@porsager
Copy link
Owner

Thx :) Not into typescript, but looks about right 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants