liter/util.rs
1//! Re-exports of dependencies used by proc-macros
2//!
3//! This module is an internal implementation detail, there are absolutely no stability guarantees.
4//!
5//! The things here are used by the [`#[database]`](crate::database) and [`#[derive(Table)]`](liter_derive::Table) procedural macros.
6//! Because the code they generate does not belong to this crate (or [`liter_derive`]), but to the crate they were invoked in, it will not have access to this [`crate`]'s (`liter`) dependencies.
7//! So, whatever they use is re-exported here so that it can be accessed under the `liter` namespace.
8
9pub use rusqlite::Result as SqlResult;
10pub use construe::construe;
11
12pub fn invalid_variant(msg: String) -> rusqlite::Error {
13 rusqlite::Error::FromSqlConversionFailure(
14 1,
15 rusqlite::types::Type::Text,
16 msg.into()
17 )
18}