ITimeSeriesDataSqlQueryBuilder<TParameter> Interface
HAKOM.TSM.Net.Api.Data.Persistence.TimeSeries.Sql
Section titled “HAKOM.TSM.Net.Api.Data.Persistence.TimeSeries.Sql”Builds SQL queries and related parameters for SQL storage readers/writers.
public interface ITimeSeriesDataSqlQueryBuilder<TParameter> where TParameter : HAKOM.Persistence.Sql.Net.Api.ISqlParameterType parameters
Section titled “Type parameters”TParameter
Methods
Section titled “Methods”ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteAllQuery(string) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteAllQuery(string) Method”Builds a query to delete all data of a time series. The time series of which the data will be deleted, is defined by sql parameters.
string BuildDeleteAllQuery(string tableName);Parameters
Section titled “Parameters”tableName System.String
The table name of the data table where the data will be deleted.
Returns
Section titled “Returns”System.String
A full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteQuotationAndHistoricDataQuery(string, string) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteQuotationAndHistoricDataQuery(string, string) Method”Builds a query to delete all data of a quotation time series with PreserveHistoricData set to true..
string BuildDeleteQuotationAndHistoricDataQuery(string historicTable, string auditTable);Parameters
Section titled “Parameters”historicTable System.String
The name of the data table where the data will be deleted.
auditTable System.String
The table name of the audit logs table where the logs will be deleted.
Returns
Section titled “Returns”System.String
A full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteTimeRangeQuery(string, FunctionType) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteTimeRangeQuery(string, FunctionType) Method”Builds a query to delete all data of a time series in a time range. The time frame, which will be deleted, is defined by sql parameters.
string BuildDeleteTimeRangeQuery(string tableName, HAKOM.TSM.Net.Api.TimeSeries.FunctionType function);Parameters
Section titled “Parameters”tableName System.String
The table name of the data table where the data will be deleted.
function FunctionType
The FunctionType of the time series, whose data will be read. Affects the where clause.
Returns
Section titled “Returns”System.String
A full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteTimeRangeWithQuotationQuery(string, bool, FunctionType) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildDeleteTimeRangeWithQuotationQuery(string, bool, FunctionType) Method”Builds a query to delete all data of a time series in a time range. The time frame, which will be deleted, is defined by sql parameters.
string BuildDeleteTimeRangeWithQuotationQuery(string tableName, bool cyclic, HAKOM.TSM.Net.Api.TimeSeries.FunctionType function);Parameters
Section titled “Parameters”tableName System.String
The table name of the data table where the data will be deleted.
cyclic System.Boolean
The Cyclic property of the time series, whose data will be deleted. Affects the where clause.
function FunctionType
The FunctionType of the time series, whose data will be deleted. Affects the where clause.
Returns
Section titled “Returns”System.String
A full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildInsertAuditDataQuery(string) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildInsertAuditDataQuery(string) Method”Builds a query to insert audit data for a time series. The data to be written, is defined by sql parameters.
string BuildInsertAuditDataQuery(string auditTable);Parameters
Section titled “Parameters”auditTable System.String
The table name of the data audit table.
Returns
Section titled “Returns”System.String
A full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildInsertAuditedQuotationEntryQuery(string) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildInsertAuditedQuotationEntryQuery(string) Method”Builds a query to insert IAuditedQuotationEntry for a time series. The data to be written, is defined by sql parameters.
string BuildInsertAuditedQuotationEntryQuery(string auditTable);Parameters
Section titled “Parameters”auditTable System.String
The table name of the data audit table.
Returns
Section titled “Returns”System.String
A full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadAuditDataQuery() Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadAuditDataQuery() Method”Builds a query to read audit data for a time series. The time frame, which will be read, is defined by sql parameters.
string BuildReadAuditDataQuery();Returns
Section titled “Returns”System.String
An full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadAuditDataQuery(string, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Period>) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadAuditDataQuery(string, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<Period>) Method”Builds a query to read audit data for a time series. The time frame, which will be read, is defined by sql parameters.
string BuildReadAuditDataQuery(string auditTable, System.Nullable<System.DateTimeOffset> modifiedSince=null, System.Nullable<System.DateTimeOffset> modifiedUntil=null, System.Nullable<HAKOM.TSM.Net.Api.Time.Periods.Period> dataPeriod=null);Parameters
Section titled “Parameters”auditTable System.String
The table name of the data audit table.
modifiedSince System.Nullable<System.DateTimeOffset>
If not null it adds an where clause to filter by audittime greater or equal to this date.
modifiedUntil System.Nullable<System.DateTimeOffset>
If not null it adds an where clause to filter by audittime lower or equal to this date.
dataPeriod System.Nullable<Period>
If not null it adds an where clause to filter by the from and to time.
Returns
Section titled “Returns”System.String
An full SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadDataQuery(CompressionMode, string, bool, FunctionType, bool) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadDataQuery(CompressionMode, string, bool, FunctionType, bool) Method”Builds a query to read data from the given tableName. The other parameters affect parts of the select and where clauses.
string BuildReadDataQuery(HAKOM.TSM.Net.Api.Data.TimeSeries.Compression.CompressionMode compressionMode, string tableName, bool cyclic, HAKOM.TSM.Net.Api.TimeSeries.FunctionType function, bool preserveHistoricData=false);Parameters
Section titled “Parameters”compressionMode CompressionMode
The CompressionMode of the time series, whose data will be read. If equal to NoCompression, a “flag” column is added to the select clause.
tableName System.String
The name of the table used in the from clause.
cyclic System.Boolean
The Cyclic property of the time series, whose data will be read. Affects the where clause.
function FunctionType
The FunctionType of the time series, whose data will be read. Affects the where clause.
preserveHistoricData System.Boolean
The PreserveHistoricData property of the time series, whose data will be read. Affects the where clause.
Returns
Section titled “Returns”System.String
An SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadHistoricQuotationDataQuery(string, string, bool, FunctionType) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadHistoricQuotationDataQuery(string, string, bool, FunctionType) Method”Builds a query to read data from the table given with the name given in historicTableName.
string BuildReadHistoricQuotationDataQuery(string historicTableName, string quotationEntryTableName, bool cyclic, HAKOM.TSM.Net.Api.TimeSeries.FunctionType function);Parameters
Section titled “Parameters”historicTableName System.String
The name of the table used in the from clause, where the quotation data is saved.
quotationEntryTableName System.String
The name of the table where the audited quotation entries are saved.
cyclic System.Boolean
The Cyclic property of the time series, whose data will be read. Affects the where clause.
function FunctionType
The FunctionType of the time series, whose data will be read. Affects the where clause.
Returns
Section titled “Returns”System.String
An SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadQuotationDataExactQuery(string, bool, FunctionType) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildReadQuotationDataExactQuery(string, bool, FunctionType) Method”Builds a query to read data from the table given with the name given in tableName.
string BuildReadQuotationDataExactQuery(string tableName, bool cyclic, HAKOM.TSM.Net.Api.TimeSeries.FunctionType function);Parameters
Section titled “Parameters”tableName System.String
The name of the table used in the from clause, where the quotation data is saved.
cyclic System.Boolean
The Cyclic property of the time series, whose data will be read. Affects the where clause.
function FunctionType
The FunctionType of the time series, whose data will be read. Affects the where clause.
Returns
Section titled “Returns”System.String
An SQL query with placeholders for some relevant parameters.
ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildWhereClauseForFunctionTypeDependentDateRange(string, bool, FunctionType, bool, bool) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.BuildWhereClauseForFunctionTypeDependentDateRange(string, bool, FunctionType, bool, bool) Method”Builds sub conditions of a query for filtering date ranges in a data reading query, depending on properties of the time series.
string BuildWhereClauseForFunctionTypeDependentDateRange(string tableName, bool cyclic, HAKOM.TSM.Net.Api.TimeSeries.FunctionType function, bool preserveHistoricData=false, bool quotation=false);Parameters
Section titled “Parameters”tableName System.String
The name of the table used in the from clause, where the data is saved.
cyclic System.Boolean
The Cyclic property of the time series, whose data will be read.
function FunctionType
The FunctionType of the time series, whose data will be read.
preserveHistoricData System.Boolean
The PreserveHistoricData property of the time series, whose data will be read.
quotation System.Boolean
The Quotation property of the time series, whose data will be read.
Returns
Section titled “Returns”System.String
Additional filtering SQL query for data reading operations (starting with AND not WHERE).
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateFromParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateFromParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateFromParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset from);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “fromTime” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateHistoricDateTimeParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateHistoricDateTimeParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateHistoricDateTimeParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset historicDateTime);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
historicDateTime System.DateTimeOffset
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “historicDateTime” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateLimitParameter(int) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateLimitParameter(int) Method”Creates an SQL parameter for queries with a limit.
TParameter CreateLimitParameter(int limit);Parameters
Section titled “Parameters”limit System.Int32
The maximum amount of return values for a query.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “limit” placeholder of the queries.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateModifiedSinceParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateModifiedSinceParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for queries with modifiedSince parameters (System.DateTimeOffset).
TParameter CreateModifiedSinceParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset modifiedSince);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
modifiedSince System.DateTimeOffset
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “modifiedSince” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateModifiedUntilParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateModifiedUntilParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for queries with modifiedUntil parameters (System.DateTimeOffset).
TParameter CreateModifiedUntilParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset modifiedUntil);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
modifiedUntil System.DateTimeOffset
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “modifiedUntil” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateQuotationDateTimeFromParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateQuotationDateTimeFromParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateQuotationDateTimeFromParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset quotationDateTimeFrom);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
quotationDateTimeFrom System.DateTimeOffset
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “quotationDateTimeFrom” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateQuotationDateTimeParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateQuotationDateTimeParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateQuotationDateTimeParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset quotationDateTime);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
quotationDateTime System.DateTimeOffset
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “quotationDateTime” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateQuotationDateTimeToParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateQuotationDateTimeToParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateQuotationDateTimeToParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset quotationDateTimeTo);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
quotationDateTimeTo System.DateTimeOffset
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “quotationDateTimeTo” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateTimeSeriesIdParameter(int) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateTimeSeriesIdParameter(int) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateTimeSeriesIdParameter(int identifier);Parameters
Section titled “Parameters”identifier System.Int32
The identifier of the time series the data is stored for.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “id” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateToParameter(TimeBase, DateTimeOffset) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateToParameter(TimeBase, DateTimeOffset) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateToParameter(HAKOM.TSM.Net.Api.Time.TimeBases.TimeBase timeBase, System.DateTimeOffset to);Parameters
Section titled “Parameters”timeBase TimeBase
The TimeBase which will be used to calculate the exact value of the parameter.
The System.DateTimeOffset on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “toTime” placeholder of the queries in this type.
ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateUserIdParameter(int) Method
Section titled “ITimeSeriesDataSqlQueryBuilder<TParameter>.CreateUserIdParameter(int) Method”Creates an SQL parameter for the queries in this type.
TParameter CreateUserIdParameter(int userId);Parameters
Section titled “Parameters”userId System.Int32
The user id on which the parameter is based.
Returns
Section titled “Returns”TParameter
An SQL parameter corresponding to the “userId” placeholder of the queries in this type.