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

Function try_dispatch

nodedb/src/control/server/pgwire/ddl/router/ast/mod.rs:26–39  ·  view source on GitHub ↗

Try to dispatch a parsed `NodedbStatement`. Returns `Some` if fully handled, `None` if the statement should fall through to the legacy dispatch.

(
    state: &SharedState,
    identity: &AuthenticatedIdentity,
    stmt: &NodedbStatement,
    database_id: DatabaseId,
)

Source from the content-addressed store, hash-verified

24/// fully handled, `None` if the statement should fall through to
25/// the legacy dispatch.
26pub(super) async fn try_dispatch(
27 state: &SharedState,
28 identity: &AuthenticatedIdentity,
29 stmt: &NodedbStatement,
30 database_id: DatabaseId,
31) -> Option<PgWireResult<Vec<Response>>> {
32 if let Some(result) = try_dispatch_guards(state, identity, stmt, database_id) {
33 return Some(result);
34 }
35 if let Some(result) = try_dispatch_sync(state, identity, stmt) {
36 return Some(result);
37 }
38 try_dispatch_async(state, identity, stmt, database_id).await
39}

Callers 1

dispatchFunction · 0.85

Calls 3

try_dispatch_guardsFunction · 0.85
try_dispatch_syncFunction · 0.85
try_dispatch_asyncFunction · 0.85

Tested by

no test coverage detected