#database #sql #orm

diesel-geography

Diesel support for PostGIS geography types and functions

2 unstable releases

0.2.0 Nov 24, 2018
0.1.0 Nov 24, 2018

#26 in #orm

Download history 22/week @ 2018-11-29 6/week @ 2018-12-06 5/week @ 2018-12-13 5/week @ 2018-12-20 6/week @ 2018-12-27 1/week @ 2019-01-03 8/week @ 2019-01-10 7/week @ 2019-01-17 3/week @ 2019-01-24 2/week @ 2019-01-31 4/week @ 2019-02-07

3 downloads per month

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

~246KB