Skip to main content

Crate cast_core

Crate cast_core 

Source
Expand description

Cast — Eloquent-shaped ORM core on top of sqlx + sea-query.

Re-exports§

pub use column::Column;
pub use column::ColumnRef;
pub use error::Error;
pub use error::Result;
pub use migration::MigrationStatus;
pub use migration::Migration;
pub use migration::MigrationRunner;
pub use model::registered_models;
pub use model::Loaded;
pub use model::Model;
pub use model::ModelRegistration;
pub use paginator::Paginator;
pub use pool::connect;
pub use pool::Connection;
pub use pool::ConnectionManager;
pub use pool::Driver;
pub use pool::Pool;
pub use query::QueryBuilder;
pub use relation::BelongsTo;
pub use relation::HasMany;
pub use relation::HasOne;
pub use relation::RelationDef;
pub use relation::RelationKind;
pub use schema::ColumnDef;
pub use schema::Schema;
pub use schema::Table;
pub use chrono;
pub use inventory;
pub use sea_query;
pub use sea_query_binder;
pub use sqlx;
pub use uuid;

Modules§

column
Typed column references. Generated by #[derive(Model)].
error
Cast-specific errors. Converted to anvil::Error at the HTTP layer.
migration
Migration runner. Each migration is a Rust value with up / down methods.
model
The Model trait — every Cast model implements this.
paginator
Pagination — mirrors Laravel’s LengthAwarePaginator.
pool
Database connection pool(s).
query
Query builder. Typed where clauses on top of sea-query + sqlx.
relation
Relationship definitions. RelationDef is implemented by zero-sized types generated by #[has_many] / #[belongs_to] attribute parsing.
schema
Schema builder. Used in migrations: Schema::create("users", |t| ...).

Macros§

migration
Closure-style migration — Laravel’s Schema::create('posts', function (Blueprint $t) { ... }) ported to Rust.
scopes
Define chainable Eloquent-style local scopes on a model’s query builder.