ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
scoped_database_helper Class Reference

Provides database context for tests with optional RBAC seeding. More...

#include <scoped_database_helper.hpp>

Collaboration diagram for scoped_database_helper:
Collaboration graph

Public Member Functions

 scoped_database_helper (bool seed_rbac=false)
 Constructs a scoped database helper.
 
void seed_rbac ()
 Seeds minimal RBAC data for tests.
 
database::contextcontext ()
 Gets the database context.
 
utility::uuid::tenant_id tenant_id ()
 Gets the test tenant ID.
 
std::string db_user ()
 Gets the database user for the current connection.
 

Detailed Description

Provides database context for tests with optional RBAC seeding.

Each test run uses an isolated tenant, so no table truncation is needed.

Constructor & Destructor Documentation

◆ scoped_database_helper()

scoped_database_helper ( bool  seed_rbac = false)
explicit

Constructs a scoped database helper.

Parameters
seed_rbacIf true, seeds minimal RBAC data (Admin role with wildcard permission)

Member Function Documentation

◆ seed_rbac()

void seed_rbac ( )

Seeds minimal RBAC data for tests.

Call this if you need RBAC data but didn't pass seed_rbac=true to constructor.

Here is the caller graph for this function: