sea-query icon indicating copy to clipboard operation
sea-query copied to clipboard

feat: Add support for postgres 'point' type

Open SindriFr opened this issue 5 months ago • 4 comments

PR Info

  • Closes #911

New Features

  • [x] Add support for postgres point type via sqlx::postgres::types::PgPoint

Breaking Changes

No breaking changes that I am aware of

SindriFr avatar Jul 17 '25 14:07 SindriFr

sorry, recently there's a lot of changes on master. can you cherry-pick your commit to merge into 0.32.x? I believe that's https://github.com/SeaQL/sea-query/pull/912/commits/77528da7c28fb02a540a1f1be34b38832056de12 ? sadly we can't depend on sqlx in the root crate, so we need to extract PgPoint to a third crate and perform conversion.

tyt2y3 avatar Aug 03 '25 22:08 tyt2y3

sorry, recently there's a lot of changes on master. can you cherry-pick your commit to merge into 0.32.x? I believe that's 77528da ? sadly we can't depend on sqlx in the root crate, so we need to extract PgPoint to a third crate and perform conversion.

Certainly! Do you need me to do anything further?

SindriFr avatar Aug 05 '25 16:08 SindriFr

@tyt2y3 You mentioned that sqlx should not be depended on by the root crate. I see that postgres_types (a dependency of sea-query) provides ToSql and FromSql implementations for geo-types Point, would you consider a merge of this branch if I used that instead? I'd need to add geo-types 0.7 as an optional dependency as well as an optional feature flag in postgres_types when the point feature is enabled.

I've created an alternate PR (#992) with the proposed changes.

SindriFr avatar Oct 02 '25 10:10 SindriFr

Just browsing here... @SindriFr that 3rd crate now is in the master, check my PR (https://github.com/SeaQL/sea-query/pull/1007), it is sea-query-postgres-types. You can add the PgPoint type.

jonasrichard avatar Nov 13 '25 08:11 jonasrichard