porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.39k stars 267 forks source link

Add support for geometric types #759

Open zadeviggers opened 9 months ago

zadeviggers commented 9 months ago

Relevant documentation

It would be nice if these were returned as arrays of numbers rather than strings.

For parsing it should be easy enough - replace parentheses (( )), braces ({ }), and chevrons (< >) with square brackets and then do a JSON.parse().

For serialising, this might be more complicated, as we'll need to make the sql() function handle arrays of arrays. It seems to work at the moment, but typescript isn't very happy about it.

I'm happy to do a PR, if you think this is worth adding @porsager.