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.Core.Queryable
Assembly: LemonEdge.API.dll
Syntax
public interface IQueryableItem
Properties
ID
The unique id of this queryable item
Declaration
string ID { get; }
Property Value
Type | Description |
---|---|
string |
IsSP
Indicates this queryableitem can only be queried from within a stored procedure
Declaration
bool IsSP { get; }
Property Value
Type | Description |
---|---|
bool |
Name
The name of this queryable item
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
SubID
The sub id for this queryable item
Declaration
string SubID { get; }
Property Value
Type | Description |
---|---|
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
string TopName { get; }
Property Value
Type | Description |
---|---|
string |
UseCore
Declaration
bool UseCore { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetCustomInitSQLForSP(long, IEnumerable<(IQueryableParamInfo Param, string SQLValue)>)
Declaration
string GetCustomInitSQLForSP(long accountID, IEnumerable<(IQueryableParamInfo Param, string SQLValue)> sqlParams)
Parameters
Type | Name | Description |
---|---|---|
long | accountID | |
IEnumerable<(IQueryableParamInfo Param, string SQLValue)> | sqlParams |
Returns
Type | Description |
---|---|
string |
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 |
---|---|
Task<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 |
---|---|
Task<IEnumerable<IQueryableParamInfo>> | All parameters that need to be used in order to call this queryable item |
GetSQLToSelectFrom(long, IEnumerable<(IQueryableParamInfo Param, string SQLValue)>, IEnumerable<string>)
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, IEnumerable<string> selectedColumnsForCheck)
Parameters
Type | Name | Description |
---|---|---|
long | accountID | The account id this sql is being generated for |
IEnumerable<(IQueryableParamInfo Param, string SQLValue)> | sqlParams | The valuesof any sql parameters used to call this queryable item |
IEnumerable<string> | selectedColumnsForCheck |
Returns
Type | Description |
---|---|
string | The sql function/table to call to return the data for this queryable item |
ReplicateForAll(string, string, long, IEnumerable<(IQueryableParamInfo Param, string SQLValue)>, IEnumerable<string>)
If this queryable item is being replicated for all then this returns a sqlselect string for each replication
Declaration
IEnumerable<string> ReplicateForAll(string dbKeyForEntityDescriptors, string originalSQLToSelectFrom, long accountID, IEnumerable<(IQueryableParamInfo Param, string SQLValue)> sqlParams, IEnumerable<string> selectedColumnsForCheck)
Parameters
Type | Name | Description |
---|---|---|
string | dbKeyForEntityDescriptors | The db key this sql is being generated for |
string | originalSQLToSelectFrom | The original sql to select from |
long | accountID | The current account id this sql is being generated for |
IEnumerable<(IQueryableParamInfo Param, string SQLValue)> | sqlParams | The valuesof any sql parameters used to call this queryable item |
IEnumerable<string> | selectedColumnsForCheck |
Returns
Type | Description |
---|---|
IEnumerable<string> | If this queryable item is being replicated for all then this returns a sqlselect string for each replication |