Lets you build SQL commands based on Korzh.EasyQuery.Db.DbQuery object
public abstract class Korzh .EasyQuery.Db.DbQueryBuilder
Package: Korzh.EasyQuery.Db (targets: netstandard2.0)
Assembly: Korzh.EasyQuery.Db.dll
Name Type Description _isParamMode boolThis property indicated whethere generated SQL should include parameters instead of real values. condFieldName stringThe name of the field in currently processing condition (used for generation of parameter names)
Name Type Description EscapeDef stringcontains escape symbol definition which will be added to the condition if necessary Extras SqlExtras Gets the Korzh.EasyQuery.Db.SqlExtras object which defines some extra clauses and options of the generated query. Formats SqlFormats Gets the formats of the result query statement. This is a structure which allows you to set different formatting option of generated SQL (or other query language) statements. For more information please read Korzh.EasyQuery.Db.SqlFormats reference. Model DbModel Gets the model. An instance of Korzh.EasyQuery.DataModel class or one of its descendants (for example DbModel) Options QueryBuilderOptions Gets or sets the builder’s options. Query DbQuery Gets the query object associated with the builder. QueryParams QueryParamList Gets the list of query parameters (for parameterized queries) Result QueryStatement QueryBuilder result. StatementType TypeGets the the statement type.
Name Type Description ConditionSqlGenerated ConditionSqlGeneratedEventHandlerThis event is raised during query building for each condition in the query and it allows you to replace the SQL expression generated for this condition.
Name Type Description Build() boolBuilds the query and stores the result in the Korzh.EasyQuery.Db.DbQueryBuilder.Result property. The result could be some SQL statement or and an IQueryable object created by LINQ query builder. CalcScalarExpr(Condition cnd, string value, DataType dataType, ScalarExprOptions exprOptions) stringCalculates the scalar value and returns SQL (or other query language) expression. This function replaces all macros with their real values first and then call Korzh.EasyQuery.Db.DbQueryBuilder.ProcessScalarValue(Korzh.EasyQuery.Condition,System.String,EasyData.DataType,Korzh.EasyQuery.ScalarExprOptions) method to get the result. GetGroupByExpr(QueryColumn column, SqlFormats formats) stringGets the column’s expression using in GROUP BY clause. GetOrderByExpr(QueryColumn column, SqlFormats formats) stringGets the columns expression for ORDER BY clause. GetParamExpr(string id) stringGets the parameter expression. GetSelectExpr(QueryColumn column, SqlFormats formats) stringGets the columns expression for SELECT clause. ProcessDefaultMacros(StringBuilder sb, bool quoting = False) voidProcesses the default macros such as ${{Today}}, ${{True}} and others. ProcessMacros(Condition cnd, StringBuilder sb, DataType dataType, ScalarExprOptions exprOptions) voidProcesses the macro values (both user-defined and default) ProcessScalarValue(Condition cnd, string value, DataType dataType, ScalarExprOptions exprOptions) stringProcesses the scalar value and returns SQL (or other query language) expression. ResetParamsIfNeeded() voidReset the list of parameters if its necessary SetExtraParams(QueryParamList extraParams) voidSets the list of extra parameters (mainly for sub-queries)