Skip to main content

Crate sql_orm

Crate sql_orm 

Source
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§

prelude

Structs§

ActiveTenant
Active tenant value currently attached to a shared connection.
AliasedEntityColumn
Public column reference bound to a SQL table alias.
AuditContext
Context passed to an AuditProvider.
AuditRequestValues
Low-level request-scoped audit values.
Collection
Marker value for a collection navigation.
DbSet
Typed entry point for querying and persisting one entity type.
DbSetQuery
Fluent query builder bound to one DbSet<E>.
DbSetQueryIncludeMany
Query builder returned by DbSetQuery::include_many::<T>(...) for a collection navigation.
DbSetQueryIncludeOne
Query builder returned by DbSetQuery::include::<T>(...) for a single included navigation.
EntityMetadata
Static metadata describing an entity.
LazyCollection
Opt-in lazy collection navigation wrapper.
LazyNavigation
Opt-in lazy single navigation wrapper.
MssqlConnectionConfig
MssqlHealthCheckOptions
MssqlOperationalOptions
MssqlPoolOptions
MssqlRetryOptions
MssqlSlowQueryOptions
MssqlTimeoutOptions
MssqlTracingOptions
Navigation
Marker value for a single related entity navigation.
NavigationMetadata
Navigation property metadata attached to an entity.
PageRequest
RawCommand
Raw SQL command for statements that do not materialize rows.
RawQuery
Typed raw SQL query that materializes rows as T.
SharedConnection
Shared database access handle used by contexts, DbSets, raw SQL, and transactions.
SoftDeleteContext
Context passed to a SoftDeleteProvider.
SoftDeleteRequestValues
Low-level request-scoped soft-delete values.
Tracked
Snapshot-based wrapper for entities tracked experimentally.

Enums§

AuditOperation
Persistence operation currently requesting audit values.
CollectionIncludeStrategy
Loading strategy for a has_many collection include.
EntityState
Lifecycle state for an experimentally tracked entity.
MssqlHealthCheckQuery
MssqlParameterLogMode
MssqlPoolBackend
NavigationKind
Relationship direction represented by a navigation property.
QueryHint
SQL Server query hints supported by typed raw queries.
SoftDeleteOperation
Persistence operation currently requesting soft-delete values.

Traits§

ActiveRecord
Convenience Active Record style API for entities.
AuditEntity
Runtime metadata hook for entities that declare #[orm(audit = Audit)].
AuditProvider
Runtime provider for audit column values.
AuditValues
Typed audit value conversion generated by #[derive(AuditFields)].
DbContext
Application database context contract.
DbContextEntitySet
Gives generic code access to the DbSet<E> declared on a context.
EntityColumnAliasExt
EntityColumnOrderExt
EntityColumnPredicateExt
IncludeCollection
Contract generated for entities that can receive an included collection navigation value.
IncludeNavigation
Contract generated for entities that can receive an included single navigation value.
MigrationModelSource
Provides entity metadata for code-first migration snapshot generation.
PredicateCompositionExt
RawParam
Converts one raw SQL parameter into an ORM SqlValue.
RawParams
Converts a parameter collection into raw SQL parameter values.
SelectProjections
SoftDeleteEntity
Runtime metadata hook for entities that declare #[orm(soft_delete = SoftDelete)].
SoftDeleteProvider
Runtime provider that mutates soft-delete changes before execution.
SoftDeleteValues
Typed soft-delete value conversion generated by #[derive(SoftDeleteFields)].
TenantContext
Runtime value shape for the active tenant configured on a context.
TenantScopedEntity
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.