Class SchemeSyncProviderBase

Assembly: redb.Core.dll

Base class for scheme synchronization provider.
Contains all reflection logic and type mapping which is database-agnostic.
SQL queries are delegated to ISqlDialect.

public abstract class SchemeSyncProviderBase : ISchemeSyncProvider, ISchemeCacheProvider

Inheritance

ObjectSchemeSyncProviderBase

Implements

Derived

Properties

Cache

Domain-bound metadata cache for this provider.

public GlobalMetadataCache Cache { get; }

IsCacheEnabled

Check if caching is enabled

public bool IsCacheEnabled { get; }

ListCache

Domain-bound list cache for this provider.

public GlobalListCache ListCache { get; }

PropsCache

Domain-bound props/object cache for this provider.

public GlobalPropsCache PropsCache { get; }

Methods

EnsureObjectSchemeAsync(string)

Get or create scheme for Object type (without Props).

public Task<IRedbScheme> EnsureObjectSchemeAsync(string name)

EnsureSchemeFromTypeAsync<TProps>()

Create/get scheme by name from Props type.

public Task<IRedbScheme> EnsureSchemeFromTypeAsync<TProps>() where TProps : class

EstimateMemoryUsage()

Estimate current memory consumption by cache in bytes

public long EstimateMemoryUsage()

FindStructureByPathAsync(long, string)

public Task<StructureTreeNode?> FindStructureByPathAsync(long schemeId, string path)

FindStructureNodeAsync(long, long)

public Task<StructureTreeNode?> FindStructureNodeAsync(long schemeId, long structureId)

GetCacheDiagnosticInfo()

Get diagnostic information about cache state

public CacheDiagnosticInfo GetCacheDiagnosticInfo()

GetCacheStatistics()

Get detailed cache performance statistics

public CacheStatistics GetCacheStatistics()

GetChildrenStructuresAsync(long, long)

public Task<List<IRedbStructure>> GetChildrenStructuresAsync(long schemeId, long parentStructureId)

GetObjectSchemeAsync(string)

Get scheme for Object type by name.

public Task<IRedbScheme?> GetObjectSchemeAsync(string name)

GetSchemeAliasForType(Type)

Get scheme alias for C# class type.

public string? GetSchemeAliasForType(Type type)

GetSchemeAliasForType<TProps>()

Get scheme alias for C# class type.

public string? GetSchemeAliasForType<TProps>() where TProps : class

GetSchemeByIdAsync(long)

Get scheme by ID.

public Task<IRedbScheme?> GetSchemeByIdAsync(long schemeId)

GetSchemeByNameAsync(string)

Get scheme by name.

public Task<IRedbScheme?> GetSchemeByNameAsync(string schemeName)

GetSchemeByTypeAsync(Type)

Get scheme by C# class type.

public Task<IRedbScheme?> GetSchemeByTypeAsync(Type type)

GetSchemeByTypeAsync<TProps>()

Get scheme by C# class type.

public Task<IRedbScheme?> GetSchemeByTypeAsync<TProps>() where TProps : class

GetSchemeFromCache(string)

Get scheme from cache synchronously (no DB call).

public IRedbScheme? GetSchemeFromCache(string schemeName)

GetSchemeFromCache<TProps>()

Get scheme from cache synchronously (no DB call).

public IRedbScheme? GetSchemeFromCache<TProps>() where TProps : class

GetSchemeNameForType(Type)

Get scheme name for C# class type.

public string GetSchemeNameForType(Type type)

GetSchemeNameForType<TProps>()

Get scheme name for C# class type.

public string GetSchemeNameForType<TProps>() where TProps : class

GetSchemesAsync()

Get all schemes.

public Task<List<IRedbScheme>> GetSchemesAsync()

GetStructuresAsync(IRedbScheme)

Get scheme structures.

public Task<List<IRedbStructure>> GetStructuresAsync(IRedbScheme scheme)

GetStructuresByTypeAsync(Type)

Get scheme structures by C# class type.

public Task<List<IRedbStructure>> GetStructuresByTypeAsync(Type type)

GetStructuresByTypeAsync<TProps>()

Get scheme structures by C# class type.

public Task<List<IRedbStructure>> GetStructuresByTypeAsync<TProps>() where TProps : class

GetStructureTreeAsync(long)

Get structure tree for scheme (cached).

public Task<List<StructureTreeNode>> GetStructureTreeAsync(long schemeId)

GetStructureTreeCacheStats()

Get structure tree cache statistics.

public (int TreesCount, int SubtreesCount, long MemoryEstimate) GetStructureTreeCacheStats()

GetStructureTreeJsonAsync(long)

public Task<string> GetStructureTreeJsonAsync(long schemeId)

GetSubtreeAsync(long, long?)

Get subtree starting from parent structure (cached).

public Task<List<StructureTreeNode>> GetSubtreeAsync(long schemeId, long? parentStructureId)

HasChildrenStructuresAsync(long, long)

public Task<bool> HasChildrenStructuresAsync(long schemeId, long structureId)

InvalidateCache()

Complete clearing of all metadata caches

public void InvalidateCache()

InvalidateSchemeCache(long)

Clear metadata cache for scheme by ID

public void InvalidateSchemeCache(long schemeId)

InvalidateSchemeCache(string)

Clear metadata cache for scheme by name

public void InvalidateSchemeCache(string schemeName)

InvalidateSchemeCache<TProps>()

Clear metadata cache for specific C# type

public void InvalidateSchemeCache<TProps>() where TProps : class

InvalidateStructureTreeCache(long)

Invalidate structure tree cache for scheme.

public void InvalidateStructureTreeCache(long schemeId)

LoadSchemeByTypeAsync(Type)

Load scheme by C# class type (throws exception if not found).

public Task<IRedbScheme> LoadSchemeByTypeAsync(Type type)

LoadSchemeByTypeAsync<TProps>()

Load scheme by C# class type (throws exception if not found).

public Task<IRedbScheme> LoadSchemeByTypeAsync<TProps>() where TProps : class

MigrateStructureTypeAsync(long, string, string, bool)

Migrate data when changing structure type (e.g. String -> Long).

public virtual Task<TypeMigrationResult> MigrateStructureTypeAsync(long structureId, string oldTypeName, string newTypeName, bool dryRun = false)

MigrateStructureTypeInternalAsync(long, long, string)

Migrate structure type (internal version with oldTypeId).

protected virtual Task MigrateStructureTypeInternalAsync(long structureId, long oldTypeId, string newTypeName)

ResetCacheStatistics()

Reset cache statistics (zero out counters)

public void ResetCacheStatistics()

SchemeExistsByNameAsync(string)

Check if scheme exists by name.

public Task<bool> SchemeExistsByNameAsync(string schemeName)

SchemeExistsForTypeAsync(Type)

Check if scheme exists for C# class type.

public Task<bool> SchemeExistsForTypeAsync(Type type)

SchemeExistsForTypeAsync<TProps>()

Check if scheme exists for C# class type.

public Task<bool> SchemeExistsForTypeAsync<TProps>() where TProps : class

SetCacheEnabled(bool)

Enable/disable metadata caching on the fly (hot toggle)

public void SetCacheEnabled(bool enabled)

SyncSchemeAsync<TProps>()

Simplified scheme synchronization method with auto-detection of name and alias.

public Task<IRedbScheme> SyncSchemeAsync<TProps>() where TProps : class

SyncStructuresFromTypeAsync<TProps>(IRedbScheme, bool)

Synchronize scheme structures from Props type (by default deletes extra fields).

public Task<List<IRedbStructure>> SyncStructuresFromTypeAsync<TProps>(IRedbScheme scheme, bool strictDeleteExtra = true) where TProps : class

ValidateStructureTreeAsync<TProps>(long)

public Task<TreeDiagnosticReport> ValidateStructureTreeAsync<TProps>(long schemeId) where TProps : class

WarmupAllSchemesAsync()

Preload metadata for all known schemes

public Task WarmupAllSchemesAsync()

WarmupCacheAsync(Type[])

Preload metadata for array of C# types

public Task WarmupCacheAsync(Type[] types)

WarmupCacheAsync<TProps>()

Preload metadata for C# type

public Task WarmupCacheAsync<TProps>() where TProps : class

Constructors