Crate toasty_core

Crate toasty_core 

Source
Expand description

Core types and abstractions for the Toasty ORM.

This crate provides the shared foundation used by all Toasty components:

  • Schema – the combined app-level, database-level, and mapping schema
  • stmt – the statement AST used to represent queries and mutations
  • driver – the trait interface that database drivers implement
  • Error / Result – unified error handling

Most users interact with the higher-level toasty crate. This crate is relevant when writing database drivers or working with schema internals.

§Examples

use toasty_core::{Schema, Error, Result};

fn check_schema(schema: &Schema) -> Result<()> {
    println!("models: {}", schema.app.models.len());
    Ok(())
}

Re-exports§

pub use driver::Connection;
pub use schema::Schema;

Modules§

driver
Database driver traits and capability descriptions. Database driver interface for Toasty.
schema
Schema definitions spanning the app layer, database layer, and the mapping between them. Schema representation for Toasty, split into three layers.
stmt
Statement AST types for representing queries, inserts, updates, and deletes. Statement AST types for Toasty’s query compilation pipeline.

Macros§

path
Constructs a stmt::Path from a dot-separated sequence of field step expressions.

Structs§

Error
The error type returned by Toasty operations. The error type used throughout Toasty.

Type Aliases§

Result
A Result type alias that uses Toasty’s Error type.