Skip to content

SqlQueryBuilder class

Lets you build SQL commands based on Korzh.EasyQuery.Db.DbQuery object

public class Korzh.EasyQuery.Db.SqlQueryBuilder
: DbQueryBuilder

Package: Korzh.EasyQuery.Db (targets: netstandard2.0)

Assembly: Korzh.EasyQuery.Db.dll

NameTypeDescription
SqlQueryBuilder(DbQuery query)voidInitializes a new instance of the Korzh.EasyQuery.Db.SqlQueryBuilder class.
NameTypeDescription
CanBuildboolGets a value indicating whether the query can be built.
PortionResultSetPortion
ResultSqlStatementGets the result.
NameTypeDescription
CondSqlGenConditionSqlGeneratedEventHandlerThis 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.
NameTypeDescription
Build()boolBuilds the query and stores the result in the Korzh.EasyQuery.Db.SqlQueryBuilder.Result property.
BuildParamSQL()boolThe same as Korzh.EasyQuery.Db.SqlQueryBuilder.BuildSQL method but generates parametrized SQL expression where all values are replaced by parameters (e.g. @param1). You can access full list of parameters used in generated SQL statement through Query.Params property.
BuildSQL()boolBuilds the SQL statement.
BuildSQLEx(string extraColumns, string extraConditions)boolBuilds the SQL with some additional columns and conditions which can be passed in parameters
GetParamExpr(string id)stringGets the parameter expression.
OnCondSqlGen(ConditionSqlGeneratedEventArgs e)voidRaises the CondSqlGen event.
ProcessScalarValue(Condition cnd, string value, DataType dataType, ScalarExprOptions exprOptions)stringProcesses scalar value and returns SQL (or some other query language) expression.
ResetSqlBuilder()voidResets the SQL builder.