Class SqliteQueryProvider

Assembly: redb.SQLite.dll

PVT-backed terminal aggregations for free SQLite. Generates the
aggregate SQL via the server-side compiler pvt_build_aggregate_sql
(free PVT v2 module) and executes the produced statement client-side,
wrapping the single result row with row_to_json to materialize
in a single round-trip after the build step.
Overrides the FilterExpression-typed virtual methods on the base provider.
Legacy facet-JSON overloads stay on the base type for dialects without
the PVT module (e.g. MSSql).

public class SqliteQueryProvider : QueryProviderBase, IRedbQueryProvider

Inheritance

Object→QueryProviderBase→SqliteQueryProvider

Implements

Derived

Inherited Members

QueryProviderBase.BuildPvtInnerSqlAsync<TProps>(QueryContext<TProps>, bool, CancellationToken),QueryProviderBase.CanUsePvtPipeline<TProps>(QueryContext<TProps>),QueryProviderBase.CanUsePvtProjection<TProps>(QueryContext<TProps>),QueryProviderBase.CheckProOnlyDistinctFeatures<TProps>(QueryContext<TProps>),QueryProviderBase.CompilesNotTrue,QueryProviderBase.CreateFacetBuilder(),QueryProviderBase.CreateFilterParser(),QueryProviderBase.CreateOrderingParser(),QueryProviderBase.CreateQuery<TProps>(long, long?, bool),QueryProviderBase.ExecuteAggregateAsync(long, string, AggregateFunction, FilterExpression?, CancellationToken),QueryProviderBase.ExecuteAggregateAsync(long, string, AggregateFunction, string?, CancellationToken),QueryProviderBase.ExecuteAggregateBatchAsync(long, IEnumerable<AggregateRequest>, FilterExpression?, CancellationToken),QueryProviderBase.ExecuteAggregateBatchAsync(long, IEnumerable<AggregateRequest>, string?, CancellationToken),QueryProviderBase.ExecuteAnyAsync<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.ExecuteArrayGroupQueryAsync(ArrayGroupQuery, CancellationToken),QueryProviderBase.ExecuteAsync(Expression, Type, CancellationToken),QueryProviderBase.ExecuteCountAsyncPvt<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.ExecuteCountAsync<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.ExecuteDeleteAsync(long, FilterExpression?, CancellationToken),QueryProviderBase.ExecuteGroupedAggregateAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, FilterExpression?, string?, CancellationToken),QueryProviderBase.ExecuteGroupedAggregateAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, string?, string?, CancellationToken),QueryProviderBase.ExecuteGroupedWindowQueryAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, CancellationToken),QueryProviderBase.ExecuteGroupedWindowQueryAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, CancellationToken),QueryProviderBase.ExecuteToListAsyncPvtProjection<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.ExecuteToListAsyncPvt<TProps>(QueryContext<TProps>, Type, CancellationToken),QueryProviderBase.ExecuteToListAsync<TProps>(QueryContext<TProps>, Type, CancellationToken),QueryProviderBase.ExecuteWindowQueryAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, int?, int?, CancellationToken),QueryProviderBase.ExecuteWindowQueryAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, int?, int?, CancellationToken),QueryProviderBase.ExistsResult(object?),QueryProviderBase.GetAggregateSqlPreviewAsync<TProps, TResult>(QueryContext<TProps>, Expression<Func<RedbObject<TProps>, TResult>>, CancellationToken),QueryProviderBase.GetArrayGroupQuerySqlAsync(ArrayGroupQuery, CancellationToken),QueryProviderBase.GetFilterJsonAsync<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.GetGroupBySqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, FilterExpression?, string?, CancellationToken),QueryProviderBase.GetGroupBySqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, string?, string?, CancellationToken),QueryProviderBase.GetGroupedWindowSqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, CancellationToken),QueryProviderBase.GetGroupedWindowSqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, CancellationToken),QueryProviderBase.GetSchemeAsync(long, CancellationToken),QueryProviderBase.GetSqlPreviewAsyncPvt<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.GetSqlPreviewAsync<TProps>(QueryContext<TProps>, CancellationToken),QueryProviderBase.GetWindowSqlPreviewAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, int?, int?, CancellationToken),QueryProviderBase.GetWindowSqlPreviewAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, int?, int?, CancellationToken),QueryProviderBase.ParseAggregateRequests(LambdaExpression),QueryProviderBase.SortsByPropsLikeLinq,QueryProviderBase.TryAllWithoutFilterAsync<TProps>(QueryContext<TProps>, FilterExpression, CancellationToken)

Methods

ExecuteAggregateAsync(long, string, AggregateFunction, FilterExpression?, CancellationToken)

Single-aggregate path. Delegates to ExecuteAggregateBatchAsync(long, IEnumerable<AggregateRequest>, FilterExpression?)

public override Task<decimal?> ExecuteAggregateAsync(long schemeId, string fieldPath, AggregateFunction function, FilterExpression? filter, CancellationToken cancellationToken = default)

ExecuteAggregateBatchAsync(long, IEnumerable<AggregateRequest>, FilterExpression?, CancellationToken)

Batch aggregate path: builds aggregations JSON, asks

public override Task<AggregateResult> ExecuteAggregateBatchAsync(long schemeId, IEnumerable<AggregateRequest> requests, FilterExpression? filter, CancellationToken cancellationToken = default)

ExecuteAggregateBatchAsync(long, IEnumerable<AggregateRequest>, string?, CancellationToken)

Batch aggregate path with pre-built facet-JSON filter. Same PVT pipeline

public override Task<AggregateResult> ExecuteAggregateBatchAsync(long schemeId, IEnumerable<AggregateRequest> requests, string? filterJson = null, CancellationToken cancellationToken = default)

ExecuteArrayGroupQueryAsync(ArrayGroupQuery, CancellationToken)

GroupByArray on the free SQLite provider: pvt_build_array_groupby_sql of the extension builds the

public override Task<JsonDocument> ExecuteArrayGroupQueryAsync(ArrayGroupQuery query, CancellationToken cancellationToken = default)

ExecuteGroupedAggregateAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, FilterExpression?, string?, CancellationToken)

Performs GroupBy aggregation with FilterExpression (Pro version).

public override Task<JsonDocument?> ExecuteGroupedAggregateAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, FilterExpression? filter, string? havingJson = null, CancellationToken cancellationToken = default)

ExecuteGroupedAggregateAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, string?, string?, CancellationToken)

GroupBy aggregation with a facet-JSON filter, built by the provider through its v2-pvt module. The base asked

public override Task<JsonDocument?> ExecuteGroupedAggregateAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, string? filterJson = null, string? havingJson = null, CancellationToken cancellationToken = default)

ExecuteGroupedWindowQueryAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, CancellationToken)

Execute GroupBy with Window Functions with FilterExpression.

public override Task<JsonDocument?> ExecuteGroupedWindowQueryAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, FilterExpression? filter, string? havingJson = null, CancellationToken cancellationToken = default)

ExecuteGroupedWindowQueryAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, CancellationToken)

Execute GroupBy with Window Functions. A provider that supports it overrides this; one that does not refuses

public override Task<JsonDocument?> ExecuteGroupedWindowQueryAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, string? filterJson = null, string? havingJson = null, CancellationToken cancellationToken = default)

ExecuteWindowQueryAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, int?, int?, CancellationToken)

Execute window query with FilterExpression (Pro version).

public override Task<JsonDocument?> ExecuteWindowQueryAsync(long schemeId, IEnumerable<WindowFieldRequest> selectFields, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, FilterExpression? filter, string? frameJson = null, int? take = null, int? skip = null, CancellationToken cancellationToken = default)

ExecuteWindowQueryAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, int?, int?, CancellationToken)

A query with window functions and a facet-JSON filter, built by the provider through its v2-pvt module. The

public override Task<JsonDocument?> ExecuteWindowQueryAsync(long schemeId, IEnumerable<WindowFieldRequest> selectFields, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, string? filterJson = null, string? frameJson = null, int? take = null, int? skip = null, CancellationToken cancellationToken = default)

GetAggregateSqlPreviewAsync<TProps, TResult>(QueryContext<TProps>, Expression<Func<RedbObject<TProps>, TResult>>, CancellationToken)

SQL preview of an AggregateAsync selector: the aggregate statement pvt_build_aggregate_sql compiles for the

public override Task<string> GetAggregateSqlPreviewAsync<TProps, TResult>(QueryContext<TProps> context, Expression<Func<RedbObject<TProps>, TResult>> selector, CancellationToken cancellationToken = default) where TProps : class, new()

GetArrayGroupQuerySqlAsync(ArrayGroupQuery, CancellationToken)

SQL of ; see there.

public override Task<string> GetArrayGroupQuerySqlAsync(ArrayGroupQuery query, CancellationToken cancellationToken = default)

GetGroupBySqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, FilterExpression?, string?, CancellationToken)

FilterExpression overload of GetGroupBySqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, string, string).

public override Task<string> GetGroupBySqlPreviewAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, FilterExpression? filter, string? havingJson = null, CancellationToken cancellationToken = default)

GetGroupBySqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, string?, string?, CancellationToken)

Returns the inner SELECT compiled by pvt_build_groupby_sql for the

public override Task<string> GetGroupBySqlPreviewAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, string? filterJson, string? havingJson = null, CancellationToken cancellationToken = default)

GetGroupedWindowSqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, FilterExpression?, string?, CancellationToken)

SQL preview for GroupBy + Window query with FilterExpression.

public override Task<string> GetGroupedWindowSqlPreviewAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, FilterExpression? filter, string? havingJson = null, CancellationToken cancellationToken = default)

GetGroupedWindowSqlPreviewAsync(long, IEnumerable<GroupFieldRequest>, IEnumerable<AggregateRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, CancellationToken)

SQL preview for GroupBy + Window query. A provider that supports it overrides this; one that does not refuses

public override Task<string> GetGroupedWindowSqlPreviewAsync(long schemeId, IEnumerable<GroupFieldRequest> groupFields, IEnumerable<AggregateRequest> aggregations, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, string? filterJson = null, string? havingJson = null, CancellationToken cancellationToken = default)

GetWindowSqlPreviewAsync(long, IEnumerable<WindowFieldRequest>, IEnumerable<WindowFuncRequest>, IEnumerable<WindowFieldRequest>, IEnumerable<WindowOrderRequest>, string?, string?, int?, int?, CancellationToken)

SQL preview for window query.

public override Task<string> GetWindowSqlPreviewAsync(long schemeId, IEnumerable<WindowFieldRequest> selectFields, IEnumerable<WindowFuncRequest> windowFuncs, IEnumerable<WindowFieldRequest> partitionBy, IEnumerable<WindowOrderRequest> orderBy, string? filterJson = null, string? frameJson = null, int? take = null, int? skip = null, CancellationToken cancellationToken = default)

Constructors