Skip to main content

sql

Macro sql 

Source
sql!() { /* proc-macro */ }
Expand description

sql! — write the statement as a literal, get a syntax check for free.

ⓘ
use arcadedb_protocol::{params, sql};

client.execute_with_values(
    sql!("UPDATE users SET status = :status UPSERT WHERE user_id = :user_id"),
    params! { status: "active", user_id },
).await?;

Catches at compile time: UPDATE clause order, unbalanced delimiters, reserved-word placeholders (:after), pasted scripts, DELETE without WHERE, INSERT without INTO, CREATE EDGE without FROM/TO. Expands to the &str unchanged. Bound params are params!’s job, not this macro’s; non-literal statements stay plain strings.