Path: redb/redb.Core/Models/Contracts/IRedbStructure.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Models/Contracts/IRedbStructure.cs
----
using System;
namespace redb.Core.Models.Contracts
{
///
/// REDB scheme field structure interface
/// Represents field metadata in object scheme
///
public interface IRedbStructure
{
///
/// Unique structure identifier
///
long Id { get; }
///
/// Parent structure identifier (for nested fields)
///
long? IdParent { get; }
///
/// Identifier of scheme to which structure belongs
///
long IdScheme { get; }
///
/// Identifier of overridden structure (for inheritance)
///
long? IdOverride { get; }
///
/// Data type identifier
///
long IdType { get; }
///
/// List identifier (for list-type fields)
///
long? IdList { get; }
///
/// Field name
///
string Name { get; }
///
/// Field alias (short name)
///
string? Alias { get; }
///
/// Field order in scheme
///
long? Order { get; }
///
/// Read-only field
///
bool? Readonly { get; }
///
/// Field is required for filling
///
bool? AllowNotNull { get; }
///
/// Collection type ID: Array (-9223372036854775668) or Dictionary (-9223372036854775667)
/// NULL for non-collection fields
///
long? CollectionType { get; }
///
/// Key type ID for Dictionary fields. NULL for non-dictionary fields
///
long? KeyType { get; }
///
/// Compress field values
///
bool? IsCompress { get; }
///
/// Store null values
///
bool? StoreNull { get; }
///
/// V4 (LAZY Л2): the reference is lazy (`virtual` on the property). With the option on,
/// the JSON builders emit a stub for it regardless of depth.
///
bool? Lazy { get; }
///
/// The field is a unique key within its scheme ([RedbUnique]); its values carry a hash in
/// _values._unique and the database enforces uniqueness over it.
///
bool? Unique { get; }
///
/// UniqueKeyEncoder.Version the stored keys were computed with; a structure whose stamp is
/// behind the current encoder is recomputed at synchronisation.
///
long? UniqueVersion { get; }
///
/// S3: element-key scope of a collection key (NULL = default reading; 1 = element values
/// unique per scheme; 2 = no duplicate elements per collection). Default implementation
/// returns null so third-party implementations keep compiling.
///
long? UniqueScope => null;
///
/// Free-form marker for future / custom extensions. Default implementation returns null.
///
string? Tags => null;
///
/// Default value (in binary form)
///
byte[]? DefaultValue { get; }
///
/// Default editor for field
///
string? DefaultEditor { get; }
}
}