Expand description
Public API surface for the SQL Server code-first ORM.
Most applications should import prelude and define entities with the
derive macros re-exported there. The crate root also exposes advanced
modules for users who need direct access to metadata, query ASTs,
migrations, SQL Server compilation, or the Tiberius adapter.
Re-exports§
pub use sql_orm_core as core;pub use sql_orm_macros as macros;pub use sql_orm_migrate as migrate;pub use sql_orm_query as query;pub use sql_orm_sqlserver as sqlserver;pub use sql_orm_tiberius as tiberius;pub use tokio;
Modules§
Structs§
- Active
Tenant - Active tenant value currently attached to a shared connection.
- Aggregate
Order By - Aggregate
Projection - Aliased
Entity Column - Public column reference bound to a SQL table alias.
- Audit
Context - Context passed to an
AuditProvider. - Audit
Request Values - Low-level request-scoped audit values.
- Collection
- Marker value for a collection navigation.
- DbSet
- Typed entry point for querying and persisting one entity type.
- DbSet
Grouped Query - Query builder returned by
DbSetQuery::group_by(...). - DbSet
Query - Fluent query builder bound to one
DbSet<E>. - DbSet
Query Include Many - Query builder returned by
DbSetQuery::include_many::<T>(...)for a collection navigation. - DbSet
Query Include One - Query builder returned by
DbSetQuery::include::<T>(...)for a single included navigation. - Entity
Metadata - Static metadata describing an entity.
- Lazy
Collection - Opt-in lazy collection navigation wrapper.
- Lazy
Navigation - Opt-in lazy single navigation wrapper.
- Mssql
Connection Config - Mssql
Health Check Options - Mssql
Operational Options - Mssql
Pool Options - Mssql
Retry Options - Mssql
Slow Query Options - Mssql
Timeout Options - Mssql
Tracing Options - Navigation
- Marker value for a single related entity navigation.
- Navigation
Metadata - Navigation property metadata attached to an entity.
- Page
Request - RawCommand
- Raw SQL command for statements that do not materialize rows.
- RawQuery
- Typed raw SQL query that materializes rows as
T. - Shared
Connection - Shared database access handle used by contexts,
DbSets, raw SQL, and transactions. - Soft
Delete Context - Context passed to a
SoftDeleteProvider. - Soft
Delete Request Values - Low-level request-scoped soft-delete values.
- Tracked
- Snapshot-based wrapper for explicitly tracked entities.
Enums§
- Aggregate
Expr - Aggregate
Predicate - Audit
Operation - Persistence operation currently requesting audit values.
- Collection
Include Strategy - Loading strategy for a
has_manycollection include. - Entity
State - Lifecycle state for a tracked entity.
- Mssql
Health Check Query - Mssql
Parameter LogMode - Mssql
Pool Backend - Navigation
Kind - Relationship direction represented by a navigation property.
- Query
Hint - SQL Server query hints supported by typed raw queries.
- Soft
Delete Operation - Persistence operation currently requesting soft-delete values.
Traits§
- Active
Record - Convenience Active Record style API for entities.
- Aggregate
Projections - Converts public
select_aggregate(...)arguments into aggregate projections. - Audit
Entity - Runtime metadata hook for entities that declare
#[orm(audit = Audit)]. - Audit
Provider - Runtime provider for audit column values.
- Audit
Values - Typed audit value conversion generated by
#[derive(AuditFields)]. - DbContext
- Application database context contract.
- DbContext
Entity Set - Gives generic code access to the
DbSet<E>declared on a context. - Entity
Column Alias Ext - Entity
Column Order Ext - Entity
Column Predicate Ext - Group
ByExpressions - Converts public
group_by(...)arguments into neutral query expressions. - Include
Collection - Contract generated for entities that can receive an included collection navigation value.
- Include
Navigation - Contract generated for entities that can receive an included single navigation value.
- Migration
Model Source - Provides entity metadata for code-first migration snapshot generation.
- Predicate
Composition Ext - RawParam
- Converts one raw SQL parameter into an ORM
SqlValue. - RawParams
- Converts a parameter collection into raw SQL parameter values.
- Select
Projections - Soft
Delete Entity - Runtime metadata hook for entities that declare
#[orm(soft_delete = SoftDelete)]. - Soft
Delete Provider - Runtime provider that mutates soft-delete changes before execution.
- Soft
Delete Values - Typed soft-delete value conversion generated by
#[derive(SoftDeleteFields)]. - Tenant
Context - Runtime value shape for the active tenant configured on a context.
- Tenant
Scoped Entity - Runtime metadata hook for entities that opt into tenant scoping.
Functions§
- connect_
shared - Opens a direct SQL Server connection and wraps it in a
SharedConnection. - connect_
shared_ with_ config - Opens a direct SQL Server connection from a fully parsed configuration.
- connect_
shared_ with_ options - Opens a direct SQL Server connection with explicit operational options.
- model_
snapshot_ from_ source - Builds a model snapshot from a context type that exposes entity metadata.
- model_
snapshot_ json_ from_ source - Serializes the current model snapshot for a context as pretty JSON.