launchbadge / sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
Apache License 2.0
12.41k stars 1.18k forks source link

Postgis location types #1361

Open bcba25 opened 2 years ago

bcba25 commented 2 years ago

Hello. Is it possible to use Postgis geography type with sqlx ? Trying to calculate a range using ST_Distance and lat/long.

letto4135 commented 2 years ago

I don't believe it is, would be a nice to have though. I wonder what the effect would be if all unknown types were just read as Strings and logged as a warning instead of throwing exceptions because I'm having issues with several types not being supported..

dbrgn commented 6 months ago

In Diesel, the diesel-geography library is really simple.

Since I don't know the sqlx codebase: What would be the steps needed to implement support for geography types in sqlx? Is this doable with custom code (i.e. by writing an extension), or does it need to be inside the sqlx codebase?

This is the only thing preventing me from migrating a codebase from Diesel to sqlx.