Skip to main content

lit

Function lit 

Source
pub fn lit<V: IntoLiteral>(value: V) -> Expr
Expand description

Create a literal expression from any type implementing IntoLiteral.

Supported types include &str / String (string literal), i32 / i64 / usize / f64 (numeric literal), and bool (boolean literal).

ยงExamples

use polyglot_sql::builder::lit;

let s = lit("hello");   // 'hello'
let n = lit(42);        // 42
let f = lit(3.14);      // 3.14
let b = lit(true);      // TRUE