1mod builder;
29pub mod changeset;
30mod client;
31mod condition;
32pub mod eager;
33mod error;
34mod ident;
35mod monitor;
36pub mod prelude;
37pub mod qb;
38mod row;
39mod sql;
40mod transaction;
41
42#[cfg(feature = "validate")]
43pub mod validate;
44
45#[cfg(feature = "migrate")]
47pub mod migrate;
48
49pub use builder::{NullsOrder, OrderBy, OrderItem, Pagination, SortDir, WhereExpr};
50pub use changeset::{ValidationCode, ValidationError, ValidationErrors};
51pub use client::GenericClient;
52pub use condition::{Condition, Op};
53pub use eager::{BelongsToMap, HasManyMap, Loaded};
54pub use error::{OrmError, OrmResult};
55pub use ident::{Ident, IdentPart, IntoIdent};
56#[cfg(feature = "tracing")]
57pub use monitor::TracingSqlHook;
58pub use monitor::{
59 CompositeHook, CompositeMonitor, HookAction, InstrumentedClient, LoggingMonitor, MonitorConfig,
60 NoopMonitor, QueryContext, QueryHook, QueryMonitor, QueryResult, QueryStats, QueryType,
61 StatsMonitor,
62};
63pub use row::{FromRow, PgType, RowExt};
64pub use sql::{Query, Sql, query, sql};
65pub use tokio_postgres::types::Json;
66
67#[cfg(feature = "migrate")]
69pub use migrate::{Migration, Report, Runner, Target, embed_migrations};
70
71#[cfg(feature = "pool")]
72mod pool;
73
74#[cfg(feature = "pool")]
75pub use client::PoolClient;
76
77#[cfg(feature = "pool")]
78pub use pool::{create_pool, create_pool_with_config};
79
80#[cfg(feature = "pool")]
81pub use pool::{create_pool_with_manager_config, create_pool_with_tls};
82
83#[cfg(feature = "derive")]
84pub use pgorm_derive::{FromRow, InsertModel, Model, QueryParams, UpdateModel, ViewModel};
85
86mod check;
88
89mod checked_client;
91
92#[cfg(feature = "check")]
94mod pg_client;
95
96pub use check::{
97 ColumnMeta, SchemaIssue, SchemaIssueKind, SchemaIssueLevel, SchemaRegistry, TableMeta,
98 TableSchema,
99};
100
101#[doc(hidden)]
103pub use inventory;
104
105#[doc(hidden)]
107pub use serde;
108
109#[doc(hidden)]
111pub use checked_client::ModelRegistration;
112
113#[cfg(feature = "check")]
114pub use checked_client::CheckedClient;
115
116#[cfg(feature = "check")]
118pub use pg_client::{
119 CheckMode, DangerousDmlPolicy, ModelCheckResult, PgClient, PgClientConfig,
120 SelectWithoutLimitPolicy, SqlPolicy,
121};
122
123#[cfg(feature = "check")]
124pub use check::{
125 CheckClient,
126 CheckError,
127 CheckResult,
128 ColumnInfo,
129 ColumnRef,
131 DbSchema,
132 LintIssue,
133 LintLevel,
134 LintResult,
135 ParseResult,
136 RelationKind,
137 SchemaCache,
138 SchemaCacheConfig,
139 SchemaCacheLoad,
140 SqlCheckIssue,
141 SqlCheckIssueKind,
142 SqlCheckLevel,
143 StatementKind,
144 TableInfo,
145 check_sql,
147 check_sql_cached,
148 delete_has_where,
149 detect_statement_kind,
150 get_column_refs,
151 get_table_names,
152 is_valid_sql,
153 lint_select_many,
154 lint_sql,
155 load_schema_from_db,
157 select_has_limit,
158 select_has_star,
159 update_has_where,
160};
161
162pub trait ModelPk {
188 type Id: Clone + Send + Sync + 'static;
190
191 fn pk(&self) -> &Self::Id;
193}
194
195#[derive(Debug, Clone)]
199pub struct WriteReport<R> {
200 pub affected: u64,
202 pub steps: ::std::vec::Vec<WriteStepReport>,
204 pub root: ::std::option::Option<R>,
206}
207
208#[derive(Debug, Clone)]
210pub struct WriteStepReport {
211 pub tag: &'static str,
214 pub affected: u64,
216}