#database #sql #orm

diesel-geography

Diesel support for PostGIS geography types and functions

2 unstable releases

Uses old Rust 2015

0.2.0 Nov 24, 2018
0.1.0 Nov 24, 2018

#378 in Database interfaces

Download history 10/week @ 2020-12-24 33/week @ 2020-12-31 8/week @ 2021-01-07 85/week @ 2021-01-14 130/week @ 2021-01-21 97/week @ 2021-01-28 116/week @ 2021-02-04 82/week @ 2021-02-11 126/week @ 2021-02-18 159/week @ 2021-02-25 90/week @ 2021-03-04 145/week @ 2021-03-11 106/week @ 2021-03-18 57/week @ 2021-03-25 55/week @ 2021-04-01 98/week @ 2021-04-08

307 downloads per month
Used in birdseed

MIT/Apache

4KB
53 lines

diesel-geography   Build Status Latest Version [docs]

Diesel support for PostGIS geography types and functions

How to use it:

In your sql schema, you have a column location geography(point, 4326) not null. When Diesel generates the schema (using table! {}) this column will look like location -> Geography. To ensure that the Geography type is in scope, read this guide and add use diesel_geography::sql_types::* to the import_types key in your diesel.toml file.

E.g. it will look like this:

[print_schema]
file = "src/schema.rs"

import_types = ["diesel::sql_types::*", "diesel_geography::sql_types::*"]

In your ORM struct, write location: GeogPoint. Now you can use this struct / table in your diesel queries.

Dependencies

~5.5MB
~133K SLoC