Macro libsql_client::args

source ·
macro_rules! args {
    () => { ... };
    ($($param:expr),+ $(,)?) => { ... };
}
Expand description

A macro for passing parameters to statements without having to manually define their types.

§Example

  let db = libsql_client::Client::from_env().await?;
  db.execute(
      Statement::with_args("INSERT INTO cart(product_id, product_name, quantity, price) VALUES (?, ?, ?, ?)",
      args!(64, "socks", 2, 4.5)),
  ).await?;