Skip to main content

comment

Function comment 

Source
pub fn comment<'a, V: SQLParam>(text: impl AsRef<str>) -> SQL<'a, V>
Expand description

Creates a free-form SQL comment: /*text*/.

The text cannot end the comment early: /* becomes / * and */ becomes * /. An empty input gives an empty fragment.

Most code calls the .comment(...) method on a dialect’s query builder instead.

§Examples

use drizzle_core::{SQL, sql::comment};

let sql: SQL<'_, Value> = comment("route=/users */ DROP");
assert_eq!(sql.sql(), "/*route=/users * / DROP*/");