rs-zero 0.2.1

Rust-first microservice framework inspired by go-zero engineering practices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use thiserror::Error;

/// Database adapter result type.
pub type DatabaseResult<T> = Result<T, DatabaseError>;

/// Database adapter errors.
#[derive(Debug, Error)]
pub enum DatabaseError {
    /// SQLx returned an error.
    #[error("database error: {0}")]
    Sqlx(#[from] sqlx::Error),

    /// The requested database kind is not enabled.
    #[error("database kind is not enabled: {0}")]
    Unsupported(String),
}