premix_orm/
lib.rs

1//! # Premix ORM 🚀
2//!
3//! > **"Write Rust, Run Optimized SQL."**
4//!
5//! Premix is a **Zero-Overhead, Type-Safe ORM** for Rust that eliminates the need for manual migration files.
6//! It combines the ease of use of Active Record with the raw performance of handcrafted SQL.
7//!
8//! ## 🌟 Key Features
9//!
10//! - **🪄 Auto-Sync Schema**: Syncs your Rust structs directly to the database.
11//! - **⚡ Zero Overhead**: Uses macros to generate SQL at compile-time.
12//! - **🚀 Application-Level Joins**: Solves N+1 problems with smart `WHERE IN` queries.
13//! - **🌍 Multi-Database**: Support for SQLite, Postgres, and MySQL.
14//!
15//! ## 🚀 Quick Start
16//!
17//! ```rust,no_run
18//! use premix_orm::prelude::*;
19//! use serde::{Serialize, Deserialize};
20//!
21//! #[derive(Model, Debug, Serialize, Deserialize)]
22//! struct User {
23//!     id: i32,
24//!     name: String,
25//! }
26//!
27//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
28//! // Connect and Sync
29//! let pool = premix_orm::sqlx::SqlitePool::connect("sqlite::memory:").await?;
30//! premix_orm::Premix::sync::<premix_orm::sqlx::Sqlite, User>(&pool).await?;
31//!
32//! // Create
33//! let mut user = User { id: 0, name: "Alice".to_string() };
34//! user.save(&pool).await?;
35//! # Ok(())
36//! # }
37//! ```
38//!
39//! ## 📦 Installation
40//!
41//! ```toml
42//! [dependencies]
43//! premix-orm = "1.0.2"
44//! ```
45
46pub use premix_core::*;
47pub use premix_macros::Model;
48
49pub mod prelude {
50    pub use premix_core::prelude::*;
51
52    pub use crate::Model; // The macro // The traits and other core items
53}