diesel_geometry 1.4.0

Adds support for geometric types and functions to Diesel.
Documentation
//! # Diesel Geometry
//!
//! Diesel Geometry is an extension to Diesel that provides support for geometric types operators.
//! If this is your first time with Diesel, we recommend starting with [diesel's getting started
//! guide]. They also have [many other long form guides].
//!
//! [diesel's getting started guide]: https://diesel.rs/guides/getting-started/
//! [many other long form guides]: https://diesel.rs/guides
//!
//! # Where to find things
//!
//! ## Declaring your schema
//!
//! So Diesel is able to validate your queries at compile time, it requires you to specify your
//! schema in your code, which you can do with the `table!` macro from Diesel.
//!
//! If you can use Diesel >= 1.3, then you can use the diesel.toml file that allows configuring the
//! schema generation process: http://diesel.rs/guides/configuring-diesel-cli/. It allows adding
//! use statements:
//!
//! ```toml
//! [print_schema]
//! # Add types from `diesel_full_text_search` like `tsvector`
//! import_types = ["diesel::sql_types::*", "diesel_geometry::sql_types::*"]
//! ```
//!
//! Otherwise for Diesel <= 1.2 you must manually modify the generated code to export the
//! `diesel_geometry` sql types inside each `table!` macro that uses diesel_geometry types. Because
//! exporting any types inside the table macro overrides the default exports, you must also
//! manually export the diesel sql types as well.
//! ### Before, as generated by `diesel print-schema` before 1.3
//!
//! ```rust
//! # static DUMMY: &'static str = r#"
//! table! {
//!     items {
//!         id -> Integer,
//!         name -> VarChar,
//!         location -> Point,
//!     }
//! }
//! # "#;
//! # fn main() {}
//! ```
//!
//! ### After manual modification
//! ```rust
//! # #[macro_use] extern crate diesel;
//! # extern crate diesel_geometry;
//! table! {
//!     use diesel::sql_types::*;
//!     use diesel_geometry::sql_types::*;
//!     items {
//!         id -> Integer,
//!         name -> VarChar,
//!         location -> Point,
//!     }
//! }
//! # fn main() {}
//! ```
//!
//! ## Getting started
//!
//! Diesel Geometry provides a [`prelude` module](prelude), which exports most of the typically
//! used traits and types.  We are conservative about what goes in this module, and avoid anything
//! which has a generic name.  Files which use Diesel Geometry are expected to have `use
//! diesel_geometry::prelude::*;`.
//!
//! ## Constructing a query
//!
//! Diesel Geometry extends Diesel in two ways.
//!
//! - "Expression methods" are things you would call on columns
//!   or other individual values.
//!   These methods live in [the `expression_methods` module](expression_methods)
//!   You can often find these by thinking "what would this be called"
//!   if it were a method
//!   and typing that into the search bar
//!   (e.g. `~=` is called `same_as` in Diesel Geometry).
//!   Most operators are named based on the Rust function which maps to that
//!   operator in [`std::ops`][]
//!   (For example `==` is called `.eq`, and `!=` is called `.ne`).
//! - "Bare functions" are normal SQL functions
//!   such as `isclosed`.
//!   They live in [the `dsl` module](dsl).
//!
//! [`std::ops`]: //doc.rust-lang.org/stable/std/ops/index.html
//! [`sql_function!`]: macro.sql_function.html
//!
//! ## Serializing and Deserializing
//!
//! Diesel Geometry maps "Rust types" (e.g. `(f64, f64)`) to and from "SQL types"
//! (e.g. [`diesel_geometry::sql_types::Point`]).
//! You can find all the types supported by Diesel Geometry in [the `sql_types` module](sql_types).
//! These types are only used to represent a SQL type.
//! You should never put them on your `Queryable` structs.
//!
//! To find all the Rust types which can be used with a given SQL type,
//! see the documentation for that SQL type.
//!
//! [`diesel_geometry::sql_types::Point`]: ::diesel_geometry::sql_types::Point
//! [`ToSql`]: ::diesel::serialize::ToSql
//! [`FromSql`]: ::diesel::deserialize::FromSql
//!
//! ## Getting help
//!
//! If you run into problems, email the developers.
//! You can come ask for help at
//! [diesel_geometry devs mailing list](mailto:diesel_geometry-devel@thinkalexandria.com)

extern crate byteorder;
#[cfg(test)]
#[macro_use]
extern crate cfg_if;
#[cfg(feature = "serde")]
#[macro_use]
extern crate serde;

#[macro_use]
extern crate diesel;

pub mod data_types;

pub mod expression;

#[cfg(feature = "postgres")]
pub mod pg;

pub mod sql_types;

#[cfg(test)]
pub mod test_helpers;

//pub mod expression;
pub mod expression_methods;

pub mod prelude {
    //! Re-exports important traits and types. Meant to be glob imported when using Diesel
    //! Geometry.
    pub use expression_methods::*;
}

pub mod dsl {
    //! Includes various helper types and bare functions which are named too
    //! generically to be included in prelude, but are often used when using Diesel Geometry.

    #[doc(inline)]
    pub use expression::dsl::*;
}