1pub mod sqlx {
21 pub use sqlx_core::Either;
22 pub use sqlx_core::acquire::Acquire;
23 pub use sqlx_core::arguments::{Arguments, IntoArguments};
24 pub use sqlx_core::column::{Column, ColumnIndex};
25 pub use sqlx_core::connection::{ConnectOptions, Connection};
26 pub use sqlx_core::database::{self, Database};
27 pub use sqlx_core::describe::Describe;
28 pub use sqlx_core::executor::{Execute, Executor};
29 pub use sqlx_core::from_row::FromRow;
30 pub use sqlx_core::pool::{self, Pool};
31 pub use sqlx_core::query::{query, query_with};
32 pub use sqlx_core::query_as::{query_as, query_as_with};
33 pub use sqlx_core::query_builder::{self, QueryBuilder};
34 pub use sqlx_core::query_scalar::{query_scalar, query_scalar_with};
35 pub use sqlx_core::raw_sql::{RawSql, raw_sql};
36 pub use sqlx_core::row::Row;
37 pub use sqlx_core::sql_str::{AssertSqlSafe, SqlSafeStr, SqlStr};
44 pub use sqlx_core::statement::Statement;
45 pub use sqlx_core::transaction::{Transaction, TransactionManager};
46 pub use sqlx_core::type_info::TypeInfo;
47 pub use sqlx_core::value::{Value, ValueRef};
48
49 pub use sqlx_core::error::{self, Error, Result};
50
51 #[cfg(feature = "decimal-rust-decimal")]
52 pub use sqlx_core::migrate;
53 #[cfg(not(feature = "decimal-rust-decimal"))]
54 pub use sqlx_core::migrate;
55
56 pub use sqlx_postgres::{
57 self as postgres, PgConnection, PgExecutor, PgPool, PgTransaction, Postgres,
58 };
59
60 pub mod types {
61 pub use sqlx_core::types::*;
62 }
63
64 pub mod encode {
65 pub use sqlx_core::encode::{Encode, IsNull};
66 }
67 pub use self::encode::Encode;
68
69 pub mod decode {
70 pub use sqlx_core::decode::Decode;
71 }
72 pub use self::decode::Decode;
73
74 pub use sqlx_core::types::Type;
75}
76
77mod audit;
78mod bound;
79mod delegate;
80mod descriptor;
81mod error;
82mod idempotency;
83mod isolated_run;
84mod isolation;
85mod json;
86mod migrations;
87mod partial_row;
88mod query;
89mod render;
90mod retriable;
91#[cfg(feature = "postgis")]
92mod spatial;
93#[cfg(test)]
94mod tests_coalesce;
95#[cfg(test)]
96mod tests_create_defaults;
97#[cfg(test)]
98mod tests_descriptor;
99#[cfg(test)]
100mod tests_field_filter;
101#[cfg(test)]
102mod tests_filter_logic;
103#[cfg(test)]
104mod tests_geography;
105#[cfg(test)]
106mod tests_json;
107#[cfg(test)]
108mod tests_nested_relation_policy;
109#[cfg(test)]
110mod tests_optional;
111#[cfg(test)]
112mod tests_pgvector;
113#[cfg(test)]
114mod tests_policy_precedence_bug;
115#[cfg(test)]
116mod tests_read_policy_field_predicates;
117#[cfg(test)]
118mod tests_read_policy_predicates;
119#[cfg(test)]
120mod tests_relation;
121#[cfg(test)]
122mod tests_relation_scope;
123#[cfg(test)]
124mod tests_relation_scope_fixtures;
125#[cfg(test)]
126mod tests_relation_scope_parity;
127#[cfg(test)]
128mod tests_relation_scope_self;
129#[cfg(test)]
130mod tests_system_principal_policy;
131#[cfg(test)]
132mod tests_update;
133#[cfg(test)]
134mod tests_update_many;
135#[cfg(test)]
136mod tests_upsert_conflict_predicate;
137mod transaction;
138
139pub use partial_row::FromPartialPgRow;
140
141pub use json::Json;
142#[cfg(feature = "pgvector")]
147pub use pgvector;
148
149#[cfg(feature = "postgis")]
153pub use spatial::Ewkb;
154
155pub use audit::{
156 AUDIT_TABLE_DDL, RunInTxOutcome, dispatch_audit_sink, primary_key_from_snapshot, snapshot_model,
157};
158pub use error::cratestack_error_from_sqlx;
159pub use idempotency::{SqlxIdempotencyStore, expiry_from};
160pub use isolation::{run_in_isolated_tx, run_in_isolated_tx_with_retries};
161pub use migrations::{
162 MIGRATIONS_TABLE_DDL, Migration, MigrationState, MigrationStatus, apply_pending,
163 ensure_migrations_table, status,
164};
165pub use transaction::Tx;
166
167pub use cratestack_policy::{PolicyExpr, PolicyLiteral, ReadPolicy, ReadPredicate};
168pub use cratestack_sql::{
169 CoalesceExpr, CoalesceFilter, ConflictTarget, CreateDefault, CreateDefaultType,
170 CreateModelInput, FieldRef, Filter, FilterExpr, FilterOp, IntoColumnName, IntoSqlValue,
171 JsonFilter, JsonTextPath, ModelColumn, ModelDescriptor, ModelPrimaryKey, NullOrder,
172 OrderClause, Orderable, Projection, RelatedReadScope, RelationFilter, RelationHop,
173 RelationInclude, RelationQuantifier, SortDirection, SqlColumnValue, SqlValue, Unorderable,
174 UpdateModelInput, UpsertModelInput, VectorDistanceExpr, VectorDistanceFilter, VectorMetric,
175 coalesce, is_orderable, order_value_sql, wrap_filter,
176};
177#[cfg(feature = "postgis")]
180pub use cratestack_sql::{SpatialDistanceExpr, SpatialFilter, SpatialPoint, point};
181pub use delegate::{
182 ModelDelegate, ScopedAggregate, ScopedAggregateColumn, ScopedAggregateCount, ScopedBatchCreate,
183 ScopedBatchDelete, ScopedBatchGet, ScopedBatchUpdate, ScopedBatchUpsert, ScopedCreateRecord,
184 ScopedDeleteMany, ScopedDeleteRecord, ScopedFindMany, ScopedFindManyWith, ScopedFindUnique,
185 ScopedModelDelegate, ScopedProjectedFindMany, ScopedProjectedFindUnique, ScopedUpdateMany,
186 ScopedUpdateManySet, ScopedUpdateRecord, ScopedUpdateRecordSet, ScopedUpsertRecord,
187 ScopedUpsertRecordDoNothing, ViewDelegate, ViewDelegateNoUnique,
188};
189pub use descriptor::{SqlxRuntime, enqueue_event_outbox, ensure_event_outbox_table};
190pub use query::{
191 Aggregate, AggregateColumn, AggregateCount, BatchCreate, BatchDelete, BatchGet, BatchUpdate,
192 BatchUpdateItem, BatchUpsert, CreateRecord, DeleteMany, DeleteRecord, FindMany, FindManyWith,
193 FindUnique, ProjectedFindMany, ProjectedFindUnique, UpdateMany, UpdateManySet, UpdateRecord,
194 UpdateRecordSet, UpsertOutcome, UpsertRecord, UpsertRecordDoNothing,
195 create_record_with_executor, update_record_with_executor,
196};