Skip to main content

col

Function col 

Source
pub fn col(name: &str) -> Expr
Expand description

Create a column reference expression.

If name contains a dot, it is split on the last . to produce a table-qualified column (e.g. "u.id" becomes u.id). Unqualified names produce a bare column reference.

ยงExamples

use polyglot_sql::builder::col;

// Unqualified column
let c = col("name");
assert_eq!(c.to_sql(), "name");

// Table-qualified column
let c = col("users.name");
assert_eq!(c.to_sql(), "users.name");