sqlx-utils 1.1.3

Utilities for working with SQLx in a structured and efficient way, both when developing and running
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::borrow::Cow;
use thiserror::Error;

pub type Result<T, E = Error> = core::result::Result<T, E>;

#[derive(Error, Debug)]
pub enum Error {
    #[error("An error occurred while executing query: {message}")]
    Repository { message: Cow<'static, str> },
    #[error(transparent)]
    Sqlx(#[from] sqlx::Error),
    #[error("Failed to acquire lock on mutex")]
    MutexLockError,
    #[error(transparent)]
    Boxed(Box<dyn std::error::Error + Send>),
}