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

Function is_session_param_fallback

nodedb/tests/pgwire_show_dispatch.rs:27–41  ·  view source on GitHub ↗

Returns true if the response is the pgwire session-parameter fallback: exactly one row, exactly one column, column name equal to `param` (case-insensitive), and an empty value.

(server: &TestServer, sql: &str, param: &str)

Source from the content-addressed store, hash-verified

25/// exactly one row, exactly one column, column name equal to `param`
26/// (case-insensitive), and an empty value.
27async fn is_session_param_fallback(server: &TestServer, sql: &str, param: &str) -> bool {
28 let rows = match server.query_named_rows(sql).await {
29 Ok(r) => r,
30 Err(_) => return false,
31 };
32 if rows.len() != 1 {
33 return false;
34 }
35 let row = &rows[0];
36 if row.len() != 1 {
37 return false;
38 }
39 row.iter()
40 .any(|(k, v)| k.eq_ignore_ascii_case(param) && v.is_empty())
41}
42
43// ── SHOW DATABASES ───────────────────────────────────────────────────
44

Callers

nothing calls this directly

Calls 4

query_named_rowsMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected