Interface IQueryableItem
A queryable item holds the definition for items that can be queried by our query tools from within the system.
By implementing this interface the system automatically can write sql queries to retrieve that data
For instance this is implenented by all EntityDescriptor to ensure all entities in the system can be queried. It is also implemented by ISQLWrapper so that you can re-query existing queriesNamespace: LemonEdge.API.Queries
Assembly: API.dll
Syntax
public interface IQueryableItem
Properties
ID
The unique id of this queryable item
Declaration
string ID { get; }
Property Value
Type | Description |
---|---|
System.String |
IsSP
Indicates this queryableitem can only be queried from within a stored procedure
Declaration
bool IsSP { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
The name of this queryable item
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
SubID
The sub id for this queryable item
Declaration
string SubID { get; }
Property Value
Type | Description |
---|---|
System.String |
TopName
If this queryable item has a subid, then the name holds the overall name, but topname holds the name of the queryable item type at the top level For instance with entities, with transactions in entities id holds the id for transactions, and name would hold transaction with permissions in entities id holds the id for permissions, sub id would hold the entity against which it holds permissions, name would hold Entity_Permission and topname would hold Permissions so we know the type is permissions
Declaration
virtual string TopName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetFields(IReadOnlyCache)
Returns all fields that can be queried from this queryable item
Declaration
Task<IEnumerable<IQueryableFieldInfo>> GetFields(IReadOnlyCache cache)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCache | cache | A local context cache |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IQueryableFieldInfo>> | All fields that can be queried from this queryable item |
GetParams(IReadOnlyCache)
Returns all parameters that need to be used in order to call this queryable item
Declaration
Task<IEnumerable<IQueryableParamInfo>> GetParams(IReadOnlyCache cache)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCache | cache | A local context cache |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IQueryableParamInfo>> | All parameters that need to be used in order to call this queryable item |
GetSQLToSelectFrom(Int64, IEnumerable<(IQueryableParamInfo Param, String SQLValue)>)
Returns the sql function/table to call to return the data for this queryable item
Declaration
string GetSQLToSelectFrom(long accountID, IEnumerable<(IQueryableParamInfo Param, string SQLValue)> sqlParams)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | accountID | The account id this sql is being generated for |
System.Collections.Generic.IEnumerable<System.ValueTuple<IQueryableParamInfo, System.String>> | sqlParams | The valuesof any sql parameters used to call this queryable item |
Returns
Type | Description |
---|---|
System.String | The sql function/table to call to return the data for this queryable item |
ReplicateForAll(String, String, Int64, IEnumerable<(IQueryableParamInfo Param, String SQLValue)>)
If this queryable item is being replicated for all then this returns a sqlselect string for each replication
Declaration
virtual IEnumerable<string> ReplicateForAll(string dbKeyForEntityDescriptors, string originalSQLToSelectFrom, long accountID, IEnumerable<(IQueryableParamInfo Param, string SQLValue)> sqlParams)
Parameters
Type | Name | Description |
---|---|---|
System.String | dbKeyForEntityDescriptors | The db key this sql is being generated for |
System.String | originalSQLToSelectFrom | The original sql to select from |
System.Int64 | accountID | The current account id this sql is being generated for |
System.Collections.Generic.IEnumerable<System.ValueTuple<IQueryableParamInfo, System.String>> | sqlParams | The valuesof any sql parameters used to call this queryable item |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | If this queryable item is being replicated for all then this returns a sqlselect string for each replication |