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 delegate;
79mod descriptor;
80mod error;
81mod idempotency;
82mod isolation;
83mod json;
84mod migrations;
85mod partial_row;
86mod query;
87mod render;
88#[cfg(feature = "postgis")]
89mod spatial;
90#[cfg(test)]
91mod tests_coalesce;
92#[cfg(test)]
93mod tests_create_defaults;
94#[cfg(test)]
95mod tests_descriptor;
96#[cfg(test)]
97mod tests_field_filter;
98#[cfg(test)]
99mod tests_filter_logic;
100#[cfg(test)]
101mod tests_geography;
102#[cfg(test)]
103mod tests_json;
104#[cfg(test)]
105mod tests_nested_relation_policy;
106#[cfg(test)]
107mod tests_optional;
108#[cfg(test)]
109mod tests_pgvector;
110#[cfg(test)]
111mod tests_policy_precedence_bug;
112#[cfg(test)]
113mod tests_read_policy_field_predicates;
114#[cfg(test)]
115mod tests_read_policy_predicates;
116#[cfg(test)]
117mod tests_relation;
118#[cfg(test)]
119mod tests_relation_scope;
120#[cfg(test)]
121mod tests_relation_scope_fixtures;
122#[cfg(test)]
123mod tests_relation_scope_parity;
124#[cfg(test)]
125mod tests_relation_scope_self;
126#[cfg(test)]
127mod tests_system_principal_policy;
128#[cfg(test)]
129mod tests_update;
130#[cfg(test)]
131mod tests_update_many;
132#[cfg(test)]
133mod tests_upsert_conflict_predicate;
134mod transaction;
135
136pub use partial_row::FromPartialPgRow;
137
138pub use json::Json;
139#[cfg(feature = "pgvector")]
144pub use pgvector;
145
146#[cfg(feature = "postgis")]
150pub use spatial::Ewkb;
151
152pub use audit::{
153 AUDIT_TABLE_DDL, RunInTxOutcome, dispatch_audit_sink, primary_key_from_snapshot, snapshot_model,
154};
155pub use error::cratestack_error_from_sqlx;
156pub use idempotency::{SqlxIdempotencyStore, expiry_from};
157pub use isolation::{run_in_isolated_tx, run_in_isolated_tx_with_retries};
158pub use migrations::{
159 MIGRATIONS_TABLE_DDL, Migration, MigrationState, MigrationStatus, apply_pending,
160 ensure_migrations_table, status,
161};
162pub use transaction::Tx;
163
164pub use cratestack_policy::{PolicyExpr, PolicyLiteral, ReadPolicy, ReadPredicate};
165pub use cratestack_sql::{
166 CoalesceExpr, CoalesceFilter, ConflictTarget, CreateDefault, CreateDefaultType,
167 CreateModelInput, FieldRef, Filter, FilterExpr, FilterOp, IntoColumnName, IntoSqlValue,
168 JsonFilter, JsonTextPath, ModelColumn, ModelDescriptor, ModelPrimaryKey, NullOrder,
169 OrderClause, Orderable, Projection, RelatedReadScope, RelationFilter, RelationHop,
170 RelationInclude, RelationQuantifier, SortDirection, SqlColumnValue, SqlValue, Unorderable,
171 UpdateModelInput, UpsertModelInput, VectorDistanceExpr, VectorDistanceFilter, VectorMetric,
172 coalesce, is_orderable, order_value_sql, wrap_filter,
173};
174#[cfg(feature = "postgis")]
177pub use cratestack_sql::{SpatialDistanceExpr, SpatialFilter, SpatialPoint, point};
178pub use delegate::{
179 ModelDelegate, ScopedAggregate, ScopedAggregateColumn, ScopedAggregateCount, ScopedBatchCreate,
180 ScopedBatchDelete, ScopedBatchGet, ScopedBatchUpdate, ScopedBatchUpsert, ScopedCreateRecord,
181 ScopedDeleteMany, ScopedDeleteRecord, ScopedFindMany, ScopedFindManyWith, ScopedFindUnique,
182 ScopedModelDelegate, ScopedProjectedFindMany, ScopedProjectedFindUnique, ScopedUpdateMany,
183 ScopedUpdateManySet, ScopedUpdateRecord, ScopedUpdateRecordSet, ScopedUpsertRecord,
184 ScopedUpsertRecordDoNothing, ViewDelegate, ViewDelegateNoUnique,
185};
186pub use descriptor::{SqlxRuntime, enqueue_event_outbox, ensure_event_outbox_table};
187pub use query::{
188 Aggregate, AggregateColumn, AggregateCount, BatchCreate, BatchDelete, BatchGet, BatchUpdate,
189 BatchUpdateItem, BatchUpsert, CreateRecord, DeleteMany, DeleteRecord, FindMany, FindManyWith,
190 FindUnique, ProjectedFindMany, ProjectedFindUnique, UpdateMany, UpdateManySet, UpdateRecord,
191 UpdateRecordSet, UpsertOutcome, UpsertRecord, UpsertRecordDoNothing,
192 create_record_with_executor, update_record_with_executor,
193};