Crates.io | diesel-geography |
lib.rs | diesel-geography |
version | 0.2.0 |
source | src |
created_at | 2018-11-24 07:32:03.624758 |
updated_at | 2018-11-24 07:53:44.188426 |
description | Diesel support for PostGIS geography types and functions |
homepage | |
repository | https://github.com/Boscop/diesel-geography |
max_upload_size | |
id | 98388 |
size | 4,555 |
Diesel support for PostGIS geography types and functions
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.