sqlquerybuilder-class
Lets you build SQL commands based on Korzh.EasyQuery.Db.DbQuery object
public class Korzh.EasyQuery.Db.SqlQueryBuilder
: DbQueryBuilder
Assembly: Korzh.EasyQuery.Db.dll
Constructors
Name | Type | Description |
---|---|---|
SqlQueryBuilder(DbQuery query) | void | Initializes a new instance of the Korzh.EasyQuery.Db.SqlQueryBuilder class. |
Properties
Name | Type | Description |
---|---|---|
CanBuild | bool | Gets a value indicating whether the query can be built. |
Portion | ResultSetPortion | |
Result | SqlStatement | Gets the result. |
Events
Name | Type | Description |
---|---|---|
CondSqlGen | ConditionSqlGeneratedEventHandler | This 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. |
Methods
Name | Type | Description |
---|---|---|
Build() | bool | Builds the query and stores the result in the Korzh.EasyQuery.Db.SqlQueryBuilder.Result property. |
BuildFromClause() | string | |
BuildGroupClause() | string | |
BuildOrderClause() | string | |
BuildParamSQL() | bool | The 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. |
BuildSelectClause() | string | |
BuildSQL() | bool | Builds the SQL statement. |
BuildSQLEx(string extraColumns, string extraConditions) | bool | Builds the SQL with some additional columns and conditions which can be passed in parameters |
CreateSqlStatement() | SqlStatement | |
GenerateTableJoins(ResultTableNode node, List <TableLink> linksToParents, StringBuilder leftBrackets) | string | |
GetDefaultSelectStatement() | string | |
GetParamExpr(string id) | string | Gets the parameter expression. |
LinkResultNode(List <ResultTableNode> resultNodes, ResultTableNode node) | void | |
OnCondSqlGen(ConditionSqlGeneratedEventArgs e) | void | Raises the CondSqlGen event. |
OuterLinkTypeIfNecessary(TableLink link, ResultTableNode node1, ResultTableNode node2) | void | |
ProcessColumns() | void | |
ProcessConditionGroup(Condition group, bool processHavingRows, string ident) | void | |
ProcessScalarValue(Condition cnd, string value, DataType dataType, ScalarExprOptions exprOptions) | string | Processes scalar value and returns SQL (or some other query language) expression. |
ResetSqlBuilder() | void | Resets the SQL builder. |