#![cfg_attr(feature = "unstable", feature(specialization))]
#![deny(warnings, missing_debug_implementations, missing_copy_implementations, missing_docs)]
#![cfg_attr(feature = "clippy", allow(unstable_features))]
#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(feature = "clippy",
allow(option_map_unwrap_or_else, option_map_unwrap_or, match_same_arms,
type_complexity))]
#![cfg_attr(feature = "clippy",
warn(option_unwrap_used, result_unwrap_used, print_stdout,
wrong_pub_self_convention, mut_mut, non_ascii_literal, similar_names,
unicode_not_nfc, enum_glob_use, if_not_else, items_after_statements,
used_underscore_binding))]
#![cfg_attr(all(test, feature = "clippy"), allow(option_unwrap_used, result_unwrap_used))]
#[cfg(feature = "postgres")]
#[macro_use]
extern crate bitflags;
extern crate byteorder;
#[cfg_attr(feature = "clippy", allow(useless_attribute))]
#[allow(unused_imports)]
#[macro_use]
extern crate diesel_derives;
#[doc(hidden)]
pub use diesel_derives::*;
#[macro_use]
mod macros;
#[cfg(test)]
#[macro_use]
extern crate cfg_if;
#[cfg(test)]
pub mod test_helpers;
pub mod associations;
pub mod backend;
#[doc(hidden)]
pub mod connection;
pub mod data_types;
pub mod deserialize;
#[macro_use]
pub mod expression;
pub mod expression_methods;
#[doc(hidden)]
pub mod insertable;
pub mod query_builder;
pub mod query_dsl;
pub mod query_source;
#[cfg(feature = "r2d2")]
pub mod r2d2;
pub mod result;
pub mod serialize;
#[macro_use]
pub mod sql_types;
pub mod types;
pub mod row;
#[cfg(feature = "mysql")]
pub mod mysql;
#[cfg(feature = "postgres")]
pub mod pg;
#[cfg(feature = "sqlite")]
pub mod sqlite;
mod type_impls;
mod util;
pub mod dsl {
#[doc(inline)]
pub use helper_types::*;
#[doc(inline)]
pub use expression::dsl::*;
}
pub mod helper_types {
use super::query_dsl::*;
use super::query_dsl::methods::*;
use super::query_source::joins;
#[doc(inline)]
pub use expression::helper_types::*;
pub type Select<Source, Selection> = <Source as SelectDsl<Selection>>::Output;
pub type Filter<Source, Predicate> = <Source as FilterDsl<Predicate>>::Output;
pub type FindBy<Source, Column, Value> = Filter<Source, Eq<Column, Value>>;
pub type ForUpdate<Source> = <Source as ForUpdateDsl>::Output;
pub type Find<Source, PK> = <Source as FindDsl<PK>>::Output;
pub type OrFilter<Source, Predicate> = <Source as OrFilterDsl<Predicate>>::Output;
pub type Order<Source, Ordering> = <Source as OrderDsl<Ordering>>::Output;
pub type Limit<Source> = <Source as LimitDsl>::Output;
pub type Offset<Source> = <Source as OffsetDsl>::Output;
pub type InnerJoin<Source, Rhs> =
<Source as JoinWithImplicitOnClause<Rhs, joins::Inner>>::Output;
pub type LeftJoin<Source, Rhs> =
<Source as JoinWithImplicitOnClause<Rhs, joins::LeftOuter>>::Output;
use super::associations::HasTable;
use super::query_builder::{AsChangeset, IntoUpdateTarget, UpdateStatement};
pub type Update<Target, Changes> = UpdateStatement<
<Target as HasTable>::Table,
<Target as IntoUpdateTarget>::WhereClause,
<Changes as AsChangeset>::Changeset,
>;
pub type IntoBoxed<'a, Source, DB> = <Source as BoxedDsl<'a, DB>>::Output;
pub type Distinct<Source> = <Source as DistinctDsl>::Output;
#[cfg(feature = "postgres")]
pub type DistinctOn<Source, Expr> = <Source as DistinctOnDsl<Expr>>::Output;
}
pub mod prelude {
pub use associations::{GroupedBy, Identifiable};
pub use connection::Connection;
#[deprecated(since = "1.1.0", note = "Explicitly `use diesel::deserialize::Queryable")]
pub use deserialize::Queryable;
pub use expression::{AppearsOnTable, BoxableExpression, Expression, IntoSql,
SelectableExpression};
pub use expression_methods::*;
#[doc(inline)]
pub use insertable::Insertable;
#[doc(hidden)]
pub use query_dsl::GroupByDsl;
pub use query_dsl::{BelongingToDsl, JoinOnDsl, QueryDsl, RunQueryDsl, SaveChangesDsl};
pub use query_source::{Column, JoinTo, QuerySource, Table};
pub use result::{ConnectionError, ConnectionResult, OptionalExtension, QueryResult};
#[cfg(feature = "postgres")]
pub use pg::PgConnection;
#[cfg(feature = "sqlite")]
pub use sqlite::SqliteConnection;
#[cfg(feature = "mysql")]
pub use mysql::MysqlConnection;
}
pub use prelude::*;
#[doc(inline)]
pub use query_builder::debug_query;
#[doc(inline)]
pub use query_builder::functions::{delete, insert_into, insert_or_ignore_into, replace_into,
select, sql_query, update};
pub use result::Error::NotFound;