Root / Assembly / ARCQuery / Class / QueryExpression

ClassAttribute

QueryExpression

KeyValue
_MemberAddParser, Execute, IPRelationsKeysPointingFrom, IPRelationsKeysPointingTo, Parsers, TryCheckForExistenceOfField, TryParse
AssemblyNameARCQuery
ClassTypeARCQuery.QueryExpression
DescriptionRepresents part of a query (or actually a transformation) against a given collection and the data storage from which it was taken.

A series of queries are usually chained together in a fluent fashion
for instance as an API call like:
'api/RQ/std/Order/WHERE Value > 1000 NOK/REL Customer/ORDER BY LastName, FirstName/TAKE 50/'
or as a C# expression like:
'new QueryProgress(DataStorage, Orders).Where("Value > 100").Rel(typeof(Customer)).OrderBy("LastName,FirstName").Take(50)'
(but in the latter case the standard LINQ extension in .NET will of course usually provide the same or better functionality (expect for AgoRapide unique queries like QueryExpressionRel)).

See also CompoundKey which expands the concept of keys.

The main purpose of the QueryExpression concept is to empower API users to create their own simple ad-hoc reports, without needing assistance from the API developers (that is, without any C# code having to be written or new API endpoints to be created).

The QueryExpression concept is not meant to be exhaustive with relation to relational modelling, nor is it proven formally.
This concept just takes away some (or actually rather quite a lot) of the need for 'hand-crafted' code in order to cover what are quite often very common scenarios.

More complex needs can be covered by ApplicationSpecificCode implementations of this class (see below).

Note that queries can also be embedded in a Subscription (but this only gives meaning when querying against a hierarchical object storage, see AdHocQuery).

Implementing classes in StandardAgoRapideCode:
QueryExpressionAll
QueryExpressionCache
QueryExpressionHint
QueryExpressionLimit
QueryExpressionOrderBy TODO: Create QueryThenBy or improve parser in QueryOrderBy in order to order by multiple fields
QueryExpressionPivot
QueryExpressionAggregate
QueryExpressionRel
QueryExpressionSelect
QueryExpressionShuffle
QueryExpressionSkip
QueryExpressionStrict
QueryExpressionTake
QueryExpressionWhere

TODO: Potential sub-classes to be added:
-QueryAggregate- (note similarity with QueryPivot)
-QueryUnion- (for instance like /UNION {subQuery})

Note that the concept is inherently expandable, you can create your own sub-classes and integrate them with StandardAgoRapideCode.
Note how any ApplicationSpecificCode implementations must be added to Parsers at application startup in order for them to be recognized by TryParse.

One practical application for ApplicationSpecificCode implementations of QueryExpression is hand-crafted reports, for instance a 'QueryExpressionReport042', available as for instance 'api/RQ/std/Report042'.
Another application could be hand-crafted HTML-representations of result sets.

See also CompoundKey (like ForeignKey, EntityMethodKey and NewKey),
FunctionKey,
QuantileKey and
ValueComparer.

The implementations of QueryExpression (together with the classes mentioned above) constitute building blocks which for instance an API end-user can fit together to construct reports as needed.
This compares well to monolithic report creation where elements can not be reused easily.
(it is similar to the UNIX philosophy of small utilities each performing a well defined easy-to-understand function).
InterfacesARCCore.ITypeDescriber; -System.IEquatable`1[ARCQuery.QueryExpression]-

5 items


Generated 2020-10-13 11:11:08.402 UTC