API Reference
Browse the REDB API documentation. Select a namespace or type from the tree on the left, or click on items below.
Search results for: Key
Clear search
Agg
redb.Core.Query.Aggregation
Average<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Average in a group: Agg.Average(g, x => x.Age)
Count<TKey, TProps>(IRedbGrouping<TKey, TProps>)
Count in a group: Agg.Count(g)
Max<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Maximum in a group: Agg.Max(g, x => x.Price)
Min<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Minimum in a group: Agg.Min(g, x => x.Price)
Sum<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Sum in a group: Agg.Sum(g, x => x.Stock)
BaseFilterExpressionParser
redb.Core.Query.Parsing
VisitDictionaryContainsKey(MethodCallExpression)
Dictionary.ContainsKey visitor.
CreateUserRequest
redb.Core.Models.Users
Key
Additional user key (optional)
E060_DictContainsKey
redb.Examples.Examples
E063_DictTupleKey
redb.Examples.Examples
E130_GroupByMultiKey
redb.Examples.Examples
ExpressionSqlCache
redb.Core.Query.Caching
BuildCacheKey<TProps>(Expression<Func<TProps, bool>>, long)
Generates stable cache key from Expression (without constant values).
BuildCacheKey<TProps>(Expression<Func<TProps, bool>>?, IEnumerable<(string field, bool desc)>?, long)
Generates cache key for ordering + filter combination.
FieldInfo
redb.Core.Query.Models
DictKey
For Dictionary fields: the key (e.g., "home" for PhoneBook["home"])
FieldPathInfo
redb.Core.Query.Projection
DictKey
Dictionary key (for AddressBook["home"])
GroupedWindowedQueryable<TKey, TProps>
redb.Core.Query.Grouping
GroupedWindowedQueryable(IRedbQueryProvider, long, Expression, GroupedWindowSpec<TKey, TProps>, FilterExpression?)
Constructor with FilterExpression (Pro version).
GroupedWindowedQueryable(IRedbQueryProvider, long, Expression, GroupedWindowSpec<TKey, TProps>, string?)
Constructor with filterJson (legacy compatibility).
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Execute query and materialize results with window functions applied to groups.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Get SQL preview for debugging.
GroupedWindowSpec<TKey, TProps>
redb.Core.Query.Grouping
OrderBy<TField>(Expression<Func<IRedbGrouping<TKey, TProps>, TField>>)
Order rows within window ascending.
OrderByDesc<TField>(Expression<Func<IRedbGrouping<TKey, TProps>, TField>>)
Order rows within window descending.
PartitionBy<TField>(Expression<Func<TKey, TField>>)
Partition window by group key field (for ranking within partitions).
IGroupedWindowedQueryable<TKey, TProps>
redb.Core.Query.Grouping
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Execute query and materialize results with window functions applied to groups.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Get SQL preview for debugging.
IGroupedWindowSpec<TKey, TProps>
redb.Core.Query.Grouping
OrderBy<TField>(Expression<Func<IRedbGrouping<TKey, TProps>, TField>>)
Order rows within window ascending.
OrderByDesc<TField>(Expression<Func<IRedbGrouping<TKey, TProps>, TField>>)
Order rows within window descending.
PartitionBy<TField>(Expression<Func<TKey, TField>>)
Partition window by group key field (for ranking within partitions).
IKeyGenerator
redb.Core.Data
IOrderedRedbQueryable<TProps>
redb.Core.Query
ThenBy<TKey>(Expression<Func<TProps, TKey>>)
Additional ascending sort by Props field.
ThenByDescending<TKey>(Expression<Func<TProps, TKey>>)
Additional descending sort by Props field.
ThenByDescendingRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Additional descending sort by IRedbObject base fields.
ThenByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Additional ascending sort by IRedbObject base fields.
IOrderingExpressionParser
redb.Core.Query.QueryExpressions
ParseMultipleOrderings<TProps>(IEnumerable<(LambdaExpression KeySelector, SortDirection Direction)>)
Parse multiple sorting
ParseOrdering<TProps, TKey>(Expression<Func<TProps, TKey>>, SortDirection)
Parse sorting expression (Props fields)
ParseRedbOrdering<TKey>(Expression<Func<IRedbObject, TKey>>, SortDirection)
🆕 Parse sorting expression by base IRedbObject fields (id, name, date_create, etc.)
IRedbContext
redb.Core.Data
Keys
Key generator with caching.
IRedbGroupedQueryable<TKey, TProps>
redb.Core.Query.Grouping
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Executes projection with aggregations for each group.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Returns SQL string that will be executed for this GroupBy query.
WithWindow(Action<IGroupedWindowSpec<TKey, TProps>>)
Apply window functions to grouped results.
IRedbGrouping<TKey, TProps>
redb.Core.Query.Grouping
Key
Group key (value by which grouped).
IRedbObject
redb.Core.Models.Contracts
Key
Object key field
IRedbOptionsBuilderInfrastructure
redb.Core.Extensions
LicenseKey
License key for Pro features (JWT token).
IRedbProjectedQueryable<TResult>
redb.Core.Query
OrderBy<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results.
OrderByDescending<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results descending.
IRedbQueryable<TProps>
redb.Core.Query
DistinctBy<TKey>(Expression<Func<TProps, TKey>>)
DISTINCT ON (field) - one object per unique Props field value.
DistinctByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
DISTINCT ON (base_field) - one object per unique IRedbObject base field value.
GroupBy<TKey>(Expression<Func<TProps, TKey>>)
Group by field with subsequent aggregation.
GroupByArray<TItem, TKey>(Expression<Func<TProps, IEnumerable<TItem>>>, Expression<Func<TItem, TKey>>)
Group by array elements (Items[].Property).
GroupByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Group by IRedbObject base fields (id, scheme_id, parent_id, etc.).
OrderBy<TKey>(Expression<Func<TProps, TKey>>)
Sort ascending by Props field.
OrderByDescending<TKey>(Expression<Func<TProps, TKey>>)
Sort descending by Props field.
OrderByDescendingRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort descending by IRedbObject base fields.
OrderByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort ascending by IRedbObject base fields (id, name, date_create, etc.).
IRedbStructure
redb.Core.Models.Contracts
KeyType
Key type ID for Dictionary fields. NULL for non-dictionary fields
ISqlDialect
redb.Core.Query
Structures_UpdateKeyType()
UPDATE structure key type. Params: $1=keyType, $2=structureId
IWindowSpec<TProps>
redb.Core.Query.Window
OrderBy<TKey>(Expression<Func<TProps, TKey>>)
Sort within window by Props field (ascending).
OrderByDesc<TKey>(Expression<Func<TProps, TKey>>)
Sort within window by Props field (descending).
OrderByDescRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort within window by IRedbObject base field (descending).
OrderByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort within window by IRedbObject base field (ascending).
PartitionBy<TKey>(Expression<Func<TProps, TKey>>)
Partition by Props field.
PartitionByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Partition by IRedbObject base field (SchemeId, OwnerId, etc.).
LicenseInfo
redb.Core.Pro.Licensing
KeyId
RSA key identifier for key rotation (e.g., "app-2024-01")
MsSqlDialect
redb.MSSql.Sql
Structures_UpdateKeyType()
UPDATE structure key type. Params: $1=keyType, $2=structureId
NpgsqlKeyGenerator
redb.Postgres.Data
GenerateKeysAsync(int)
Generate batch of keys from PostgreSQL sequence.
NpgsqlKeyGenerator(NpgsqlDataSource)
Create PostgreSQL key generator.
NpgsqlKeyGenerator(string)
Create PostgreSQL key generator from connection string.
NpgsqlRedbContext
redb.Postgres.Data
Keys
Key generator with caching.
ObjectRecord
redb.Export.Models
Key
Optional numeric key.
OrderingExpressionParser
redb.Core.Query
ParseMultipleOrderings<TProps>(IEnumerable<(LambdaExpression KeySelector, SortDirection Direction)>)
Parse multiple orderings.
ParseOrdering<TProps, TKey>(Expression<Func<TProps, TKey>>, SortDirection)
Parse ordering expression for Props fields.
ParseRedbOrdering<TKey>(Expression<Func<IRedbObject, TKey>>, SortDirection)
Parse sorting by base IRedbObject fields (id, name, date_create, etc.)
PostgreSqlDialect
redb.Postgres.Sql
Structures_UpdateKeyType()
UPDATE structure key type. Params: $1=keyType, $2=structureId
RedbArrayGroupedQueryable<TKey, TItem, TProps>
redb.Core.Query.Grouping
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TItem>, TResult>>)
Executes projection with aggregations for each group.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TItem>, TResult>>)
Returns SQL string for array GroupBy query.
WithWindow(Action<IGroupedWindowSpec<TKey, TItem>>)
WithWindow not supported for array grouping.
RedbContextBase
redb.Core.Data
Keys
Key generator.
RedbGroupedQueryable<TKey, TProps>
redb.Core.Query.Grouping
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Executes projection with aggregations for each group.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Returns SQL string that will be executed for this GroupBy query.
WithWindow(Action<IGroupedWindowSpec<TKey, TProps>>)
Apply window functions to grouped results.
RedbKeyGeneratorBase
redb.Core.Data
GenerateKeysAsync(int)
Generate batch of keys from database sequence.
RedbKeySerializer
redb.Core.Utils
CanBeKey(Type)
Check if C# type is valid as Dictionary key
Deserialize<TKey>(string)
Deserialize _array_index text value to key
GetKeyTypeId(Type)
Get RedbTypeIds constant for key type
IsComplexKey(Type)
Check if key type is a complex type requiring JSON serialization
Serialize<TKey>(TKey)
Serialize key to _array_index text value
RedbObject
redb.Core.Models.Entities
RedbObjectRow
redb.Core.Models.Entities
Key
External key for integration.
RedbProjectedQueryable<TProps, TResult>
redb.Core.Query
OrderBy<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results.
OrderByDescending<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results descending.
RedbProjectedQueryableTaskExtensions
redb.Core.Query
RedbQueryable<TProps>
redb.Core.Query
DistinctBy<TKey>(Expression<Func<TProps, TKey>>)
DISTINCT ON (field) - one object per unique Props field value.
DistinctByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
DISTINCT ON (base_field) - one object per unique IRedbObject base field value.
GroupBy<TKey>(Expression<Func<TProps, TKey>>)
Grouping with aggregations.
GroupByArray<TItem, TKey>(Expression<Func<TProps, IEnumerable<TItem>>>, Expression<Func<TItem, TKey>>)
Grouping by array elements
GroupByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Grouping by base IRedbObject fields (id, scheme_id, parent_id, etc.)
OrderBy<TKey>(Expression<Func<TProps, TKey>>)
Sort ascending by Props field.
OrderByDescending<TKey>(Expression<Func<TProps, TKey>>)
Sort descending by Props field.
OrderByDescendingRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort descending by IRedbObject base fields.
OrderByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort ascending by IRedbObject base fields (id, name, date_create, etc.).
ThenBy<TKey>(Expression<Func<TProps, TKey>>)
Additional ascending sort by Props field.
ThenByDescending<TKey>(Expression<Func<TProps, TKey>>)
Additional descending sort by Props field.
ThenByDescendingRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Additional descending sort by IRedbObject base fields.
ThenByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Additional ascending sort by IRedbObject base fields.
RedbStructure
redb.Core.Models.Entities
KeyType
Key type ID for Dictionary fields. NULL for non-dictionary fields.
RedbTypeMapping
redb.Core.Utils
CanBeKey(long)
Check if type can be used as Dictionary key
SchemeMetadataCacheRow
redb.Core.Pro.Models
SqlKeyGenerator
redb.MSSql.Data
GenerateKeysAsync(int)
Generate batch of keys from MSSQL sequence.
SqlKeyGenerator(string)
Create MSSQL key generator from connection string.
SqlRedbContext
redb.MSSql.Data
Keys
Key generator with caching.
StructureRecord
redb.Export.Models
KeyType
Key type for dictionary-typed fields.
TreeGroupedQueryable<TKey, TProps>
redb.Core.Query.Grouping
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Executes projection with aggregations for each group.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Returns SQL string that will be executed for this GroupBy query.
WithWindow(Action<IGroupedWindowSpec<TKey, TProps>>)
Apply window functions to grouped results (tree-aware).
TreeGroupedWindowedQueryable<TKey, TProps>
redb.Core.Query.Grouping
SelectAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Execute query and materialize results with window functions applied to groups.
ToSqlStringAsync<TResult>(Expression<Func<IRedbGrouping<TKey, TProps>, TResult>>)
Get SQL preview for debugging.
TreeProjectedQueryable<TProps, TResult>
redb.Core.Query
OrderBy<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results.
OrderByDescending<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results descending.
TreeQueryableBase<TProps>
redb.Core.Query.Base
DistinctBy<TKey>(Expression<Func<TProps, TKey>>)
DISTINCT ON (field) - one object per unique Props field value.
DistinctByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
DISTINCT ON (base_field) - one object per unique IRedbObject base field value.
GroupBy<TKey>(Expression<Func<TProps, TKey>>)
Override GroupBy to respect tree context (rootObjectId, maxDepth, ParentIds).
GroupByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Override GroupByRedb to respect tree context.
OrderBy<TKey>(Expression<Func<TProps, TKey>>)
✅ FIX ISSUE #4: Override OrderBy to preserve Tree context
OrderByDescending<TKey>(Expression<Func<TProps, TKey>>)
✅ FIX ISSUE #4: Override OrderByDescending for Tree context
OrderByDescendingRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort descending by IRedbObject base fields.
OrderByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort ascending by IRedbObject base fields (id, name, date_create, etc.).
ThenBy<TKey>(Expression<Func<TProps, TKey>>)
✅ FIX ISSUE #4: Override ThenBy for Tree context
ThenByDescending<TKey>(Expression<Func<TProps, TKey>>)
✅ FIX ISSUE #4: Override ThenByDescending for Tree context
ThenByDescendingRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Additional descending sort by IRedbObject base fields.
ThenByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Additional ascending sort by IRedbObject base fields.
TrustedIssuers
redb.Core.Pro.Licensing
GetPublicKey(string, string)
Gets the public key for a specific issuer and key ID.
UpdateUserRequest
redb.Core.Models.Users
Key
New additional key (if null - not changed)
UserRecord
redb.Export.Models
Key
Optional numeric key.
UserSearchCriteria
redb.Core.Models.Users
KeyValue
Filter by user key (exact match)
UserSortField
redb.Core.Models.Users
ValueTupleDictionaryConverter<TKey, TValue>
redb.Core.Serialization
Write(Utf8JsonWriter, Dictionary<TKey, TValue>?, JsonSerializerOptions)
Writes a specified value as JSON.
WindowSpec<TProps>
redb.Core.Query.Window
OrderBy<TKey>(Expression<Func<TProps, TKey>>)
Sort within window by Props field (ascending).
OrderByDesc<TKey>(Expression<Func<TProps, TKey>>)
Sort within window by Props field (descending).
OrderByDescRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort within window by IRedbObject base field (descending).
OrderByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Sort within window by IRedbObject base field (ascending).
PartitionBy<TKey>(Expression<Func<TProps, TKey>>)
Partition by Props field.
PartitionByRedb<TKey>(Expression<Func<IRedbObject, TKey>>)
Partition by IRedbObject base field (SchemeId, OwnerId, etc.).