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

Function setup_foo_db

nodedb/tests/auth_admin_ddl_gating.rs:21–32  ·  view source on GitHub ↗

Pre-create a database named `foo` and return its `DatabaseId`.

(state: &nodedb::control::state::SharedState)

Source from the content-addressed store, hash-verified

19
20// Pre-create a database named `foo` and return its `DatabaseId`.
21async fn setup_foo_db(state: &nodedb::control::state::SharedState) -> DatabaseId {
22 let su = superuser();
23 ddl_ok(state, &su, "CREATE DATABASE foo").await;
24 state
25 .credentials
26 .catalog()
27 .as_ref()
28 .expect("catalog must be present")
29 .get_database_id_by_name("foo")
30 .unwrap()
31 .expect("foo db must exist after CREATE DATABASE")
32}
33
34// ─── CREATE DATABASE ──────────────────────────────────────────────────────────
35

Calls 6

superuserFunction · 0.85
ddl_okFunction · 0.85
expectMethod · 0.45
as_refMethod · 0.45
catalogMethod · 0.45

Tested by

no test coverage detected