Create an object with the given conditions and default value. An expression can be provided to test each condition against, instead of having all conditions represent their own boolean expression.
Extends Instance PropertiesProperty | Type | Default Value | Description |
conditions | the conditions of the patio.sql.CaseExpression. | ||
def | the default value of the patio.sql.CaseExpression. | ||
expression | the expression of the patio.sql.CaseExpression. | ||
hasExpression | Boolean | returns true if this case expression has a expression | |
noExpression | Boolean | true if this patio.sql.CaseExpression's expression is undefined. | |
function (conditions,def,expression){ if (Expression.isConditionSpecifier(conditions)) { this.conditions = toArray(conditions); this.def = def; this.expression = expression; this.noExpression = isUndefined(expression); } }
Converts the case expression to a string
Argumentsdataset used to created the SQL fragment, if the dataset is ommited then the default patio.Dataset implementation is used.
String the SQL case expression fragment.
function (ds){ !Dataset && (Dataset = require("./dataset")); ds = ds || new Dataset(); return ds.caseExpressionSql(this); }