feat(core): add sqlx::RawValue

This commit is contained in:
Ryan Leckey 2021-02-26 00:19:42 -08:00
parent 163d5cb1b3
commit 6b5f37dfb1
No known key found for this signature in database
GPG Key ID: F8AA68C235AB08C9

View File

@ -0,0 +1,16 @@
use std::any;
use crate::database::HasRawValue;
use crate::{decode, Database, Decode, TypeDecode, TypeInfo};
// NOTE: Add decode() and decode_unchecked() to RawValue as provided methods
// once Rust has lazy normalization and/or GATs.
pub trait RawValue<'r>: Sized {
type Database: Database;
/// Returns `true` if this value is the SQL `NULL`.
fn is_null(&self) -> bool;
/// Returns the type information for this value.
fn type_info(&self) -> &'r <Self::Database as Database>::TypeInfo;
}