MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / placeholder_inside_string_literal_untouched

Function placeholder_inside_string_literal_untouched

nodedb-sql/src/dsl_bind.rs:171–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169 /// as part of `Token::SingleQuotedString`, not as a placeholder.
170 #[test]
171 fn placeholder_inside_string_literal_untouched() {
172 let bound = bind_dsl(
173 "UPSERT INTO t (id, note) VALUES ($1, 'your $1 change')",
174 &[ParamValue::Text("abc".into())],
175 )
176 .unwrap();
177 assert!(
178 bound.as_str().contains("'your $1 change'"),
179 "string literal was rewritten: {}",
180 bound.as_str()
181 );
182 assert!(
183 bound.as_str().contains("'abc'"),
184 "real placeholder not bound: {}",
185 bound.as_str()
186 );
187 }
188
189 #[test]
190 fn null_param() {

Callers

nothing calls this directly

Calls 1

bind_dslFunction · 0.85

Tested by

no test coverage detected