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

[BUG]: Geometry type ignores SRID option #2675

Open
matthiasfeist opened this issue Jul 22, 2024 · 2 comments · May be fixed by #2774 or #2803
Open

[BUG]: Geometry type ignores SRID option #2675

matthiasfeist opened this issue Jul 22, 2024 · 2 comments · May be fixed by #2774 or #2803
Labels
bug Something isn't working db/postgres drizzle/kit priority Will be worked on next

Comments

@matthiasfeist
Copy link

What version of drizzle-orm are you using?

0.32.0

What version of drizzle-kit are you using?

0.23.0

Describe the Bug

The new Postgis geometry type has an option for the SRID but never passes it into the field definition SQL here and here.

This is similar to issue #2454 where the geometry type also never passes the "type" to the SQL field definition.

Expected behavior

For a schema entry like this

geom: geometry("geom", {
      type: "point",
      mode: "xy",
      srid: 4326,
    }).notNull(),

I would expect a SQL field definition like this:
geometry(point, 4326)

Environment & setup

No response

@matthiasfeist matthiasfeist added the bug Something isn't working label Jul 22, 2024
@mauriciabad mauriciabad linked a pull request Aug 9, 2024 that will close this issue
@mauriciabad
Copy link

I opened a PR fixing this #2774

@jbccollins
Copy link

This bug essentially makes the geometry type unusable. To work around this I need to use the raw sql insertion from the docs: 'sqlST_SetSRID(ST_MakePoint(-90.9, 18.7), 4326),'

IMO this workaround kinda defeats the purpose of using an ORM. I see that there is a PR open to fix this. Can this be prioritized for the next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working db/postgres drizzle/kit priority Will be worked on next
Projects
None yet
4 participants