Crate atmosphere

source ·
Expand description

§🌍 Atmosphere

A lightweight sql framework for sustainable database reliant systems

§Overview

Atmosphere is a lightweight SQL framework designed for sustainable, database-reliant systems. It leverages Rust’s powerful type and macro systems to derive SQL schemas from your rust struct definitions into an advanced trait system.

Atmosphere provides a suite of modules and types that abstract and facilitate various aspects of database operations, from query construction and execution to error handling and schema management.

§Key Features

  • SQL schema derivation from Rust structs.
  • Advanced trait system for query generation.
  • Automated database code testing with atmosphere::testing
  • ORM-like CRUD traits.
  • Code reusability across API layers using generics.
  • Compile-time introspection for type-safe schema generation.

§Usage

To use this crate you must activate one of the following features (else the crate is empty):

  • mysql
  • postgres
  • sqlite

Modules§

  • Facilitates binding entities to queries, ensuring type safety and ease of use in query construction. Bind Module for Atmosphere SQL Framework
  • Driver System
  • Defines high-level database error types, offering a structured approach to error handling. Error Handling Module for Atmosphere
  • Implements a hook system, allowing custom logic to be executed at different stages of database interactions. Atmosphere Hook System
  • A prelude module for bringing commonly used types into scope
  • Offers an abstraction layer for building and executing SQL queries, simplifying complex query logic. Provides structures and enums for handling and executing SQL queries, along with error handling.
  • Models SQL relationships, providing tools to define and manipulate relationships between database entities. Provides traits for managing relationships between database entities.
  • Manages the runtime environment for database operations, encompassing execution contexts and configurations. Runtime Module for Atmosphere SQL Framework
  • Contains compile-time generated SQL schema traits, enabling a declarative approach to schema definition. SQL Schema
  • The async SQL toolkit for Rust, built with ❤️ by the LaunchBadge team.
  • Provides utilities for automated testing of SQL interactions, ensuring reliability and correctness of database operations. Provides functions for automated database testing.

Structs§

  • Defines a standard data column in the table.
  • Represents a foreign key column, establishing a relationship to another table.
  • Describes the primary key column of a table.
  • Specifies a timestamp column, typically used for tracking creation, update, or deletion times.

Enums§

  • Enumerates errors that can occur during the binding of values to SQL queries.
  • An enum that encapsulates different column types of a table.
  • Errors that can occur within Atmosphere.

Traits§

  • Trait for binding columns to SQL queries in the context of a specific table.
  • Trait for dynamic binding of values.
  • Trait for creating rows in a database.
  • Trait for deleting rows from a database.
  • Trait representing an Entity that maps to a database table.
  • Trait for reading rows from a database.
  • SQL Table Definition
  • Update rows in a database.

Type Aliases§

  • Atmosphere Database Driver
  • Atmosphere Database Pool
  • A specialized Result type for use throughout the Atmosphere framework.

Attribute Macros§

  • An attribute macro for registering on a table. Must be used after #[derive(Schema)].
  • An attribute macro that stores metadata about the sql table. Must be used after #[derive(Schema)].

Derive Macros§

  • A derive macro that processes structs to automatically generate schema-related code. It reads custom attributes and derives necessary traits and implementations for interacting with the database.