#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Value {
Integer(i64),
Blob(Vec<u8>),
Text(String),
Null,
}
impl From<i64> for Value {
fn from(v: i64) -> Self {
Self::Integer(v)
}
}
impl From<Vec<u8>> for Value {
fn from(v: Vec<u8>) -> Self {
Self::Blob(v)
}
}
impl From<&[u8]> for Value {
fn from(v: &[u8]) -> Self {
Self::Blob(v.to_vec())
}
}
impl From<String> for Value {
fn from(v: String) -> Self {
Self::Text(v)
}
}
impl From<&str> for Value {
fn from(v: &str) -> Self {
Self::Text(v.to_string())
}
}
#[macro_export]
macro_rules! params {
($($val:expr),* $(,)?) => {
&[$($crate::Value::from($val)),*][..]
};
}