mod builder;
pub mod changeset;
mod client;
mod condition;
pub mod eager;
mod error;
mod ident;
mod monitor;
pub mod prelude;
pub mod qb;
mod row;
mod sql;
mod transaction;
#[cfg(feature = "validate")]
pub mod validate;
#[cfg(feature = "migrate")]
pub mod migrate;
pub use builder::{NullsOrder, OrderBy, OrderItem, Pagination, SortDir, WhereExpr};
pub use changeset::{ValidationCode, ValidationError, ValidationErrors};
pub use client::GenericClient;
pub use condition::{Condition, Op};
pub use eager::{BelongsToMap, HasManyMap, Loaded};
pub use error::{OrmError, OrmResult};
pub use ident::{Ident, IdentPart, IntoIdent};
#[cfg(feature = "tracing")]
pub use monitor::TracingSqlHook;
pub use monitor::{
CompositeHook, CompositeMonitor, HookAction, InstrumentedClient, LoggingMonitor, MonitorConfig,
NoopMonitor, QueryContext, QueryHook, QueryMonitor, QueryResult, QueryStats, QueryType,
StatsMonitor,
};
pub use row::{FromRow, PgType, RowExt};
pub use sql::{Query, Sql, query, sql};
pub use tokio_postgres::types::Json;
#[cfg(feature = "migrate")]
pub use migrate::{Migration, Report, Runner, Target, embed_migrations};
#[cfg(feature = "pool")]
mod pool;
#[cfg(feature = "pool")]
pub use client::PoolClient;
#[cfg(feature = "pool")]
pub use pool::{create_pool, create_pool_with_config};
#[cfg(feature = "pool")]
pub use pool::{create_pool_with_manager_config, create_pool_with_tls};
#[cfg(feature = "derive")]
pub use pgorm_derive::{FromRow, InsertModel, Model, UpdateModel, ViewModel};
mod check;
mod checked_client;
#[cfg(feature = "check")]
mod pg_client;
pub use check::{
ColumnMeta, SchemaIssue, SchemaIssueKind, SchemaIssueLevel, SchemaRegistry, TableMeta,
TableSchema,
};
#[doc(hidden)]
pub use inventory;
#[doc(hidden)]
pub use serde;
#[doc(hidden)]
pub use checked_client::ModelRegistration;
#[cfg(feature = "check")]
pub use checked_client::CheckedClient;
#[cfg(feature = "check")]
pub use pg_client::{
CheckMode, DangerousDmlPolicy, ModelCheckResult, PgClient, PgClientConfig,
SelectWithoutLimitPolicy, SqlPolicy,
};
#[cfg(feature = "check")]
pub use check::{
CheckClient,
CheckError,
CheckResult,
ColumnInfo,
ColumnRef,
DbSchema,
LintIssue,
LintLevel,
LintResult,
ParseResult,
RelationKind,
SchemaCache,
SchemaCacheConfig,
SchemaCacheLoad,
SqlCheckIssue,
SqlCheckIssueKind,
SqlCheckLevel,
StatementKind,
TableInfo,
check_sql,
check_sql_cached,
delete_has_where,
detect_statement_kind,
get_column_refs,
get_table_names,
is_valid_sql,
lint_select_many,
lint_sql,
load_schema_from_db,
select_has_limit,
select_has_star,
update_has_where,
};
pub trait ModelPk {
type Id: Clone + Send + Sync + 'static;
fn pk(&self) -> &Self::Id;
}
#[derive(Debug, Clone)]
pub struct WriteReport<R> {
pub affected: u64,
pub steps: ::std::vec::Vec<WriteStepReport>,
pub root: ::std::option::Option<R>,
}
#[derive(Debug, Clone)]
pub struct WriteStepReport {
pub tag: &'static str,
pub affected: u64,
}