Skip to content

Diesel support for PostGIS geography types and functions

Notifications You must be signed in to change notification settings

Boscop/diesel-geography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diesel-geography   Build Status Latest Version docs

Diesel support for PostGIS geography types and functions

Example usage:

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.

About

Diesel support for PostGIS geography types and functions

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages