Skip to main content

Crate prax_sqlite

Crate prax_sqlite 

Source
Expand description

SQLite database driver for Prax ORM.

This crate provides SQLite support for the Prax ORM, using tokio-rusqlite for asynchronous database operations.

§Features

  • Async/await support via tokio-rusqlite
  • Connection pooling
  • Type-safe query building
  • Transaction support
  • In-memory and file-based databases

§Example

use prax_sqlite::{SqlitePool, SqliteConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = SqliteConfig::from_url("sqlite://./mydb.db")?;
    let pool = SqlitePool::new(config).await?;

    // Use the pool...
    Ok(())
}

See SqliteEngine’s doc block for 0.7 breaking changes.

Re-exports§

pub use config::DatabasePath;
pub use config::JournalMode;
pub use config::SqliteConfig;
pub use config::SynchronousMode;
pub use connection::SqliteConnection;
pub use engine::SqliteEngine;
pub use error::SqliteError;
pub use error::SqliteResult;
pub use pool::PoolConfig;
pub use pool::SqlitePool;
pub use pool::SqlitePoolBuilder;
pub use raw::SqliteJsonRow;
pub use raw::SqliteRawEngine;
pub use row::FromSqliteRow;

Modules§

config
SQLite configuration.
connection
SQLite connection wrapper.
engine
SQLite query engine implementing prax_query::QueryEngine.
error
Error types for SQLite operations.
pool
Connection pool for SQLite.
raw
Legacy JSON-first SQLite query engine.
row
Row deserialization traits for SQLite.
row_ref
Bridge between rusqlite rows and prax_query::row::RowRef.
types
Type conversion utilities for SQLite.