Attribute Macro akita_derive::sql

source · []
#[sql]
Expand description

auto create sql macro,this macro use RB.fetch_prepare and RB.exec_prepare

for example:
    pub static AK:Lazy = Lazy::new(|| {
        let mut cfg = AkitaConfig::new("xxxx".to_string()).set_max_size(5).set_connection_timeout(Duration::from_secs(5)).set_log_level(LogLevel::Info);
        kita::new(cfg).unwrap()
    });
    #[sql(AK,"select * from mch_info where mch_no = ?")]
    fn select(name: &str) -> Vec { todo!() }

or:
   #[sql(AK,"select * from mch_info where mch_no = ?")]
    fn select(ak: &AKita, name: &str) -> Vec { todo!() }