omit Sql properties absent from TransactionSql in type definition #1121
Conversation
4a0fe34 to
3a43815
Compare
|
Thx :) Not into typescript, but looks about right 😅 |
|
@porsager / @maxcbc this caused a pretty serious regression, i.e. all sql.begin(async (sql) => {
await sql`my query`; // <== error here:
// TS2349: This expression is not callable.
// Type TransactionSql<{}> has no call signatures.
});See Dimous's comment here: 36a53f6#commitcomment-170665877 @maxcbc do you mind either preparing a revert, or fixing forward? ...also I'm kinda curious, @maxcbc how did this regression not show up in your codebase? Afaict like every sql`` within a @porsager I get you personally do not like TypeScript, but some amount of type checking-as-unit-tests in the postgres.js build/release process would likely be a good idea, otherwise folks maintaining these types are just guessing about what will/will not fix/improve/regress the types. |
|
So @porsager even though this probably broke the code of every typescript user of this library and the issue was raised well before releasing the new version - "I don't like typescript"? |
|
Tell me if there's a PR or make one, and I'll merge and make a release. |
TransactionSql is missing properties from Sql added in
postgres/src/index.js
Lines 69 to 82 in 32feb25
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: