AutoQuery RDBMS built-in operands

I know you can pass things like FieldNameStartWith=XYZ in query string to find all records where FieldName start with ‘XYZ’. Is there a list of all these Operands that are available in query string?

There is a list of implicit queries if you don’t want to explicitly control them on your DTOs.

2 Likes

Is it possible to Or queries using implicit queries?

Like:

?Field1Or=X&Field2Or=Y

resulting in SQL like:

Field1 = ‘X’ OR Field2 = ‘Y’

That’s not currently supported, you would use the QueryDbField attribute with Term, otherwise your own Template to control custom behavior. Alternatively you could customize the ImplicitConventions on the AutoQueryFeature plugin to create your own implicit conventions.

I’ll also add whilst you can’t mix and match AND/OR conditions in the same query by default, you could create another API with inverse behavior where every condition is an OR query, e.g:

[QueryDb(QueryTerm.Or)]
public class FindItems : QueryDb<Item>
{
    public int[] Ids { get; set; }
    public List<string> Names { get; set; }
}