PostGIS Diesel
Extension for Diesel framework to support PostGIS types.
Example of Usage
To ensure that the Geometry
type is in scope, read this guide and add postgis_diesel::sql_types::*
to the import_types key in your diesel.toml
file.
Assume that the table is defined like this:
CREATE EXTENSION IF NOT EXISTS postgis;
(
id SERIAL PRIMARY KEY,
point geometry(Point,4326) NOT NULL,
linestring geometry(Linestring,4326) NOT NULL
);
Then Rust code may look like this:
extern crate diesel;
use *;
use *;
table!
See integration test for more complete example.
How to Run Tests
- Start Postgis DB
- Run tests
cargo test