Skip to main content

Module prelude

Module prelude 

Source
Expand description

Prelude module for convenient imports.

use sqlmodel::prelude::*;

Re-exports§

pub use crate::ConnectionSession;
pub use crate::ConnectionSessionBuilder;

Modules§

select
SELECT query builder.

Macros§

delete
Create a DELETE query for a model.
insert
Create an INSERT query for a model.
select
Create a SELECT query for a model.
update
Create an UPDATE query for a model.

Structs§

Budget
A budget constraining resource usage for a task or region.
Cx
The capability context for a task.
DumpOptions
Options for model_dump() and model_dump_json().
FieldsSet
A compact bitset representing “field is set” for indices 0..len.
GetOptions
Options for Session::get_with_options().
Hybrid
A hybrid property wrapper.
Join
A JOIN clause.
Migration
A database migration.
MigrationRunner
Migration runner for executing migrations.
ObjectKey
Unique key for an object in the identity map.
OrderBy
ORDER BY clause.
PolymorphicJoinedSelect
A polymorphic SELECT for joined-table inheritance base + single child.
PolymorphicJoinedSelect2
A polymorphic SELECT for joined-table inheritance base + two children.
PolymorphicJoinedSelect3
A polymorphic SELECT for joined-table inheritance base + three children.
Pool
A connection pool for database connections.
PoolConfig
Connection pool configuration.
RegionId
A unique identifier for a region in the runtime.
Row
A single row returned from a database query.
Select
A SELECT query builder.
Session
The Session is the central unit-of-work manager.
SessionConfig
Configuration for Session behavior.
TaskId
A unique identifier for a task in the runtime.
TrackedModel
A model instance with explicit “fields set” tracking.
ValidateOptions
Options for model_validate().

Enums§

DumpMode
Output mode for model_dump().
Error
The primary error type for all SQLModel operations.
Expr
A SQL expression that can be used in WHERE, HAVING, etc.
JoinType
Types of SQL joins.
ObjectState
State of a tracked object in the session.
Outcome
The four-valued outcome of a concurrent operation.
PolymorphicJoined
Output of a joined-table inheritance polymorphic query with a single child type.
PolymorphicJoined2
Output of a joined-table inheritance polymorphic query with two child types.
PolymorphicJoined3
Output of a joined-table inheritance polymorphic query with three child types.
ValidateInput
Input types for model_validate().
Value
A dynamically-typed SQL value.

Traits§

Connection
Model
Trait for types that can be mapped to database tables.
ModelDump
Trait for models that support model_dump().
SqlModelDump
Model-aware dump that supports field aliases and computed field exclusion.
SqlModelValidate
Model-aware validation that supports field aliases.

Functions§

create_table
Create a table for a model type.

Type Aliases§

Result
Result type alias for SQLModel operations.
ValidateResult
Result type for model_validate operations.

Derive Macros§

Model
Derive macro for the Model trait.
SqlEnum
Derive macro for SQL enum types.
Validate
Derive macro for field validation.