Closed demetris-manikas closed 3 months ago
The build seems to hang at the typeorm test I guess. The dynamic loading seems to be ok in the dev env but failing during ci/cd. This may go far... Since I cannot debug this, and I understand you not wanting to get into this, feel free to reject this PR.
Thanks for trying to do this! However, while the type safety may be nice, like you said the added complexity likely isn't worth it.
This PR adds a bit more of type safety.
I had to abandon the PoolConfig since "weirdly" enough the typeorm and pg interfaces don't align in at least two places
one is the type definition of the password property since unfortunately
() => string | undefined
!==() => string | () => undefined
and the other being the type definition of the
ssl.pskCallback
function.I rearranged a few pieces for better readability.
I also added a small utility function that has proven very useful for me when dealing with enum like types.
Let me know what you think.