Skip to content

Commit

Permalink
adds Supported features check.
Browse files Browse the repository at this point in the history
  • Loading branch information
jas-valgotar committed Jan 23, 2025
1 parent 00f5877 commit 2921b16
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ internal CdpTableValue(IRContext irContext)

public override IEnumerable<DValue<RecordValue>> Rows => GetRowsAsync(null, null, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();

public DelegationParameterFeatures SupportedFeatures => DelegationParameterFeatures.Filter |
DelegationParameterFeatures.Top |
DelegationParameterFeatures.Columns | // $select
DelegationParameterFeatures.Sort; // $orderby

public async Task<IReadOnlyCollection<DValue<RecordValue>>> GetRowsAsync(IServiceProvider services, DelegationParameters parameters, CancellationToken cancel)
{
if (parameters == null && _cachedRows != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public enum DelegationParameterFeatures
// $apply = groupby((field1, ..), field with sum as TotalSum)
ApplyGroupBy = 1 << 5,

// $count
Count = 1 << 6,

/*
To be implemented later when needed
// $compute
Compute = 1 << 5,
// $count
Count = 1 << 6,
// $expand
Expand = 1 << 7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public interface IDelegatableTableValue
/// <param name="parameters">Delegation parameters.</param>
/// <param name="cancel"></param>
Task<FormulaValue> ExecuteQueryAsync(IServiceProvider services, DelegationParameters parameters, CancellationToken cancel);

/// <summary>
/// Supported features for delegation to verify correct Features are delegated at runtime.
/// </summary>
DelegationParameterFeatures SupportedFeatures { get; }
}

/// <summary>
Expand Down

0 comments on commit 2921b16

Please sign in to comment.