Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Postgis Point type as number[] #312

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

joecarver
Copy link
Contributor

This PR simply adds an extra type to cli/src/types.ts, for the Postgis column type point. The type is a number[]. Technically it could be typed more strictly as [number, number], but I believe that would involve more significant changes to pgTyped, and this is perfectly acceptable for our purposes.

I have tested this by building the code and linking the @pgtyped/cli package to my application. It successfully removes the column type not supported by mapping errors that I was seeing before.

Apologies if I have missed anything. Let me know if there are any further changes to make! Thank you.

This is a rudimentary solution to the issue discussed in #232, although only for the point type. I would be happy to add more Postgis types if there is demand for it.

@vercel
Copy link

vercel bot commented Aug 17, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/adels/pgtyped/75Pb31WyFHdeqSQtDd6Het71SgUy
✅ Preview: https://pgtyped-git-fork-joecarver-add-postgis-point-type-adels.vercel.app

@joecarver
Copy link
Contributor Author

@adelsz sorry to nag but is there any chance this PR could get a look? I noticed a similar one #320 was merged recently, and this would be super super helpful! Thanks :)

Copy link
Owner

@adelsz adelsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joecarver! Looks good

@adelsz adelsz merged commit c117c39 into adelsz:master Sep 16, 2021
@JesseVelden
Copy link
Contributor

JesseVelden commented Jan 2, 2022

@joecarver I'm currently looking into this, but I noticed that the default pg client parses a point to {x: number, y: number} source and not as [number, number]. Any chance you're not using this with pg, and if so, what are you using instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants