use std::fmt::{Debug};
use chrono::Local;
use convert_case::{Case, Casing};
pub fn to_database_string<T:Debug>(t:T)->String {
let a=format!("{:?}",t);
let c=a.trim_matches('"');
if c.len()+2==a.len(){
return format!("'{}'",c.replace("'","''"));
}
c.to_string()
}
pub trait IMyString{
fn to_underscored(&self) -> String;
fn to_cameled(&self) -> String;
}
impl IMyString for str {
fn to_underscored(&self) -> String{
self.to_case(Case::Snake)
}
fn to_cameled(&self) -> String{
self.to_case(Case::UpperCamel)
}
}
#[macro_export]
macro_rules! mystring_variable_name {
($val:expr $(,)?) => {
String::from(stringify!($val))
};
}