serverless icon indicating copy to clipboard operation
serverless copied to clipboard

Correct type of `types` option to `CustomTypesConfig`

Open andyjy opened this issue 1 year ago • 2 comments

Context: https://github.com/neondatabase/serverless/pull/110#issuecomment-2459199983

I've also updated the example in CONFIG.md, although the way pg's types are written seem to require userland use of any on the format parameter and as typeof PgTypes.getTypeParser cast on the custom implementation of getTypeParser(), which is quite displeasing 😭

It may be preferable to keep the current example for simplicity (as it doesn't require these userland typescript workarounds), potentially with a warning about global scope pollution. 🤷‍♂️

andyjy avatar Nov 06 '24 10:11 andyjy

@jawj I would be happy to update this PR for the new refactor if you would like to accept it?

Context/reasoning in the linked issue: https://github.com/neondatabase/serverless/pull/110#issuecomment-2458992991

Small beans really but there is currently a type cast in a fix I wrote for the Prisma Neon adapter that can be removed to tidy things up from a type safety perspective if this is accepted.

andyjy avatar Feb 11 '25 22:02 andyjy

Ditto, thanks, this looks good: will gladly merge if updated.

jawj avatar Feb 13 '25 14:02 jawj

Rolling this into a new PR ...

jawj avatar Jun 06 '25 12:06 jawj