Expand description
siderite-orm: backend-neutral ORM core.
Model/ModelMeta: models and their static metadata, generated by#[derive(Model)].QuerySet: lazy, immutable queries compiled into aQueryPlan.Expr/Field: the typed expression DSL (DjangoQ,F, lookups).WritePlan: INSERT / UPDATE / DELETE.Db: the handle application code uses (pool or transaction).Executor/Backend/Transaction: implemented by adapters insiderite-backends; plans are checked againstBackendCapabilitiesbefore any I/O.
This crate has no HTTP dependencies; the HTTP layer converts
OrmError into API errors.
Re-exports§
pub use backend::Backend;pub use backend::ExecResult;pub use backend::Executor;pub use backend::QueryResult;pub use backend::Row;pub use backend::Transaction;pub use capabilities::BackendCapabilities;pub use capabilities::BackendKind;pub use capabilities::Feature;pub use capabilities::IsolationLevel;pub use capabilities::RowLocking;pub use capabilities::TransactionSupport;pub use db::Databases;pub use db::Db;pub use decode::FromValues;pub use error::CursorError;pub use error::BackendCapabilityError;pub use error::BackendError;pub use error::OrmError;pub use error::QueryError;pub use expr::functions;pub use expr::AggFunc;pub use expr::Aggregate;pub use expr::ArrayAgg;pub use expr::Avg;pub use expr::BinaryOp;pub use expr::Calc;pub use expr::CaseBuilder;pub use expr::Column;pub use expr::Count;pub use expr::CumeDist;pub use expr::DateLike;pub use expr::DatePart;pub use expr::DenseRank;pub use expr::Expr;pub use expr::Field;pub use expr::FirstValue;pub use expr::FkSlot;pub use expr::Function;pub use expr::Joined;pub use expr::Lag;pub use expr::LastValue;pub use expr::Lead;pub use expr::Literal;pub use expr::Lookup;pub use expr::Max;pub use expr::Min;pub use expr::Ntile;pub use expr::Numeric;pub use expr::Operand;pub use expr::PercentRank;pub use expr::Rank;pub use expr::RelHop;pub use expr::Related;pub use expr::RelatedColumn;pub use expr::RowNumber;pub use expr::StdDev;pub use expr::StringAgg;pub use expr::Sum;pub use expr::TextLike;pub use expr::TimeLike;pub use expr::UnaryOp;pub use expr::Variance;pub use expr::Window;pub use expr::WindowFunc;pub use model::ConstraintMeta;pub use model::DbDefault;pub use model::FieldMeta;pub use model::IndexMeta;pub use model::ManyToManyMeta;pub use model::MetaRef;pub use model::Model;pub use model::ModelMeta;pub use model::OnDelete;pub use model::RelationKind;pub use model::RelationMeta;pub use model::read_column;pub use ops::ModelOps;pub use plan::Compound;pub use plan::DistinctMode;pub use plan::JoinExpr;pub use plan::JoinKind;pub use plan::LockMode;pub use plan::OrderDirection;pub use plan::OrderExpr;pub use plan::PlanOrigin;pub use plan::QueryPlan;pub use plan::QuerySource;pub use plan::SelectExpr;pub use plan::SetOp;pub use queryset::CursorPage;pub use queryset::Page;pub use queryset::Prefetch;pub use queryset::QuerySet;pub use queryset::Relation;pub use relations::ForeignKey;pub use relations::ManyToManyManager;pub use relations::OneToOne;pub use types::DbType;pub use types::SqlType;pub use value::Value;pub use write::DeletePlan;pub use write::InsertPlan;pub use write::UpdatePlan;pub use write::WritePlan;
Modules§
- backend
- Executor, backend and transaction traits implemented by database adapters.
- capabilities
- Backend capability model.
- db
Db: the database handle application code passes around.- decode
- Typed decoding of dynamic result rows:
FromValuesforvalues_list,Row::get_asandQueryResult::decodefor raw SQL. - error
- ORM error hierarchy. HTTP mapping lives in
siderite-core. - expr
- Typed expression AST (Django
Q/F/ lookup equivalents). - model
- The
Modeltrait and its staticModelMeta. - ops
- Instance operations:
ModelOpsgives everyModelsave,deleteandrefresh(DjangoModel.save()/delete()/refresh_from_db()). - plan
QueryPlan: the backend-neutral intermediate representation.- queryset
QuerySet: a lazy, immutable query over one model.- relations
- Relation field types.
- router
- Database routing: pick the database alias for reads and writes
(Django
DATABASE_ROUTERS). - signals
- Model lifecycle signals:
pre_save,post_save,pre_delete,post_deleteandm2m_changed(Djangodjango.db.models.signals). - types
- Mapping between Rust field types, SQL column types and
Value. - value
- Backend-neutral scalar values used for bind parameters and decoded rows.
- write
WritePlan: backend-neutral INSERT / UPDATE / DELETE.
Macros§
- params
- Build a
Vec<Value>of bind parameters:params![id, "name"].