Interface IRedbService

Namespace: redb.Core
Assembly: redb.Core.dll

Main REDB service interface - composition of all providers.

public interface IRedbService : ISchemeSyncProvider, IObjectStorageProvider, ITreeProvider, IPermissionProvider, IQueryableProvider, IValidationProvider, IRedbScopeSource

Properties

CacheDomain

Cache domain identifier for this service instance.

string CacheDomain { get; }

Configuration

Current service configuration.

RedbServiceConfiguration Configuration { get; }

Context

Database context for direct SQL queries.

IRedbContext Context { get; }

dbMigration

Database migration version.

string dbMigration { get; }

dbSize

Database size in bytes, as the server reports it (optional).

long? dbSize { get; }

dbType

Database type (e.g., "PostgreSQL").

string dbType { get; }

dbVersion

string dbVersion { get; }

ListProvider

Provider for list management.

IListProvider ListProvider { get; }

Maintenance

Storage maintenance: planner statistics (AnalyzeAsync after bulk writes) and

IMaintenanceProvider Maintenance { get; }

RoleProvider

Provider for role management.

IRoleProvider RoleProvider { get; }

SchemaProblems

Problems of the database schema that do not stop the service but need a person, as found by the last

IReadOnlyList<RedbSchemaProblem> SchemaProblems { get; }

SecurityContext

Security context for user and permission management.

IRedbSecurityContext SecurityContext { get; }

UserProvider

Provider for user management.

IUserProvider UserProvider { get; }

Methods

BeginAccess()

Makes this service the scope lazy loads run on, for the returned block (owner decision 2026-09-15): a data

IDisposable BeginAccess()

CheckSchemaAsync(CancellationToken)

Looks for schema problems in the database again (read only, no schema lock) and returns the current list,

Task<IReadOnlyList<RedbSchemaProblem>> CheckSchemaAsync(CancellationToken cancellationToken = default)

CreateSystemContext()

Create temporary system context.

IDisposable CreateSystemContext()

EnsureDatabaseAsync()

Ensures the REDB database schema exists.

Task EnsureDatabaseAsync()

GetDbVersionAsync(CancellationToken)

Asynchronously retrieves the database version using the provider-specific version SQL.

Task<string?> GetDbVersionAsync(CancellationToken cancellationToken = default)

GetEffectiveUserId()

Get effective user ID with fallback logic.

long GetEffectiveUserId()

GetSchemaScript()

Returns the full SQL script that creates the REDB schema.

string GetSchemaScript()

GetUpgradeScript()

Returns the SQL script that brings an existing database up to the module version this

string? GetUpgradeScript()

InitializeAsync(bool, params Assembly[])

Initialize REDB system at application startup, optionally creating the database schema first.

Task InitializeAsync(bool ensureCreated, params Assembly[] assemblies)

InitializeAsync(params Assembly[])

Initialize REDB system at application startup.

Task InitializeAsync(params Assembly[] assemblies)

LoadLinkedObjectsAsync(IEnumerable<RedbListItem>, CancellationToken)

Loads the linked objects of items in one query on this service's connection, publishes them

Task<IReadOnlyDictionary<long, IRedbObject>> LoadLinkedObjectsAsync(IEnumerable<RedbListItem> items, CancellationToken cancellationToken = default)

SetCurrentUser(IRedbUser)

Set current user.

void SetCurrentUser(IRedbUser user)

UpdateConfiguration(Action<RedbServiceConfiguration>)

Update configuration.

void UpdateConfiguration(Action<RedbServiceConfiguration> configure)

UpdateConfiguration(Action<RedbServiceConfigurationBuilder>)

Update configuration via builder.

void UpdateConfiguration(Action<RedbServiceConfigurationBuilder> configureBuilder)