Fix https://github.com/porsager/postgres/issues/1143#1144
Fix https://github.com/porsager/postgres/issues/1143#1144sep2 wants to merge 1 commit intoporsager:masterfrom
Conversation
`Omit` will not work, a common interface `ISql` for `Sql` and `TransactionSql` is introduced. microsoft/TypeScript#41362
|
Won't that include all properties that aren't valid for TransactionSql ? I think the proper way is to make an explicit definition of TransactionSql instead of inherit. Perhaps better to use Type instead of Interface. |
|
Only actual properties are included in the interfaces. Properties not in the runtime
I used |
|
It would be good to add a unit test, like what is common in DefinitelyTyped. |
|
To prevent the same hazard as previous PR, can some more people with typescript knowledge approve this? |
|
@porsager I opened the original issue (#1143), and I can confirm that this looks good to me. I've also tested this in my project, and it resolves the issue that I was seeing. @sep2's line of thinking, of moving all shared properties ( |
|
The only nitpick I would have is that since there's already an existing interface called A more descriptive name might be |
|
I would prefer the type to be unknown instead of any. The rest LGTM |
…ngs types issues (ref: porsager/postgres#1144)
|
Please merge this, the library is unusable right now on the latest version. The changes LGTM too. |
|
cc @Minigugus @Newbie012 @thebearingedge in case you have a moment to review the types fix here Currently in the middle of teaching a cohort of students, but I'll try to put this on my list for the coming weeks if you don't have time |
@porsager to automatically verify both this types PR and also future types PRs, one option that could also be considered would be to add some types tests using a project such as:
Also, if using Vitest would be an option, then it has type testing built in: |
* chore: npm update. * fix: fix overloads after npm update. * chore: fix linting. * chore: downgrade postgres again because of porsager/postgres#1144.
Omitwill not work, a common interfaceISqlforSqlandTransactionSqlis introduced.microsoft/TypeScript#41362