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

Function ddl_err

nodedb-test-support/src/pgwire_auth_helpers.rs:90–95  ·  view source on GitHub ↗

Run DDL, expect error; return the error string for assertions.

(state: &SharedState, identity: &AuthenticatedIdentity, sql: &str)

Source from the content-addressed store, hash-verified

88
89/// Run DDL, expect error; return the error string for assertions.
90pub async fn ddl_err(state: &SharedState, identity: &AuthenticatedIdentity, sql: &str) -> String {
91 let result = ddl::dispatch(state, identity, sql, nodedb_types::id::DatabaseId::DEFAULT).await;
92 assert!(result.is_some(), "DDL not recognized: {sql}");
93 let err = result.unwrap().unwrap_err();
94 err.to_string()
95}
96
97/// Run DDL and return the result without panicking on either branch. Useful
98/// when the gate test only cares whether the privilege check fired (look for

Calls 2

to_stringMethod · 0.80
dispatchFunction · 0.50