ScalarSqlExpression <X> Quantify <X>(
     ScalarSqlExpression <X> expression,
     string quantifier
     )
 {
     Field(expression);
     return(Statement.Quantify <X>(quantifier));
 }
 FieldlessSelectBuilder OrderByImpl(
     ScalarSqlExpression expression,
     OrderDirection direction
     )
 {
     Statement.OrderKeys.Add(new OrderKey(expression, direction));
     return(this);
 }
Beispiel #3
0
        public static ScalarSqlExpression <string> Concat(
            this ScalarSqlExpression <string> lhs,
            params ScalarSqlExpression <string>[] rhs
            )
        {
            var part = Invoke("concat", new[] { lhs }.Concat(rhs));

            return(new ConcreteScalarSqlExpression <string>(lhs.SqlBuilder, part));
        }
Beispiel #4
0
 public static SqlCondition IsNull <X>(
     this ScalarSqlExpression <X> lhs
     )
 {
     return
         (new AtomicSqlCondition(
              lhs.SqlBuilder,
              lhs.Concat(SqlPart.FromString("is null")).Tokens
              ));
 }
Beispiel #5
0
 public static SqlCondition Equal <X>(
     this ScalarSqlExpression <X> lhs,
     ScalarSqlExpression <X> rhs
     )
 {
     return
         (new AtomicSqlCondition(
              lhs.SqlBuilder,
              lhs.Concat(SqlPart.FromString("=")).Concat(rhs).Tokens
              ));
 }
 internal AliasedScalarSqlExpression(ScalarSqlExpression <TValue> expression, string alias)
     : base(expression.SqlBuilder)
 {
     Expression = expression;
     Alias      = alias;
 }
Beispiel #7
0
 public static ScalarSqlExpression <X> Unbox <X>(this ScalarSqlExpression expression)
 {
     return(new ConcreteScalarSqlExpression <X>(expression.SqlBuilder, expression.Tokens));
 }
Beispiel #8
0
 public OrderKey(ScalarSqlExpression expression, OrderDirection direction)
 {
     Expression = expression;
     Direction  = direction;
 }
 public ScalarSqlExpression <X> ToScalar <X>(ScalarSqlExpression <X> expression)
 {
     Field(expression);
     return(Statement.ToScalar <X>());
 }
 public SelectBuilder Field(ScalarSqlExpression expression)
 {
     Statement.Fields.Add(expression);
     return(new SelectBuilder(Statement));
 }
 public FieldlessSelectBuilder OrderByDescending(ScalarSqlExpression column)
 {
     return(OrderByImpl(column, OrderDirection.Descending));
 }
 public FieldlessSelectBuilder GroupBy(ScalarSqlExpression expression)
 {
     Statement.GroupKeys.Add(expression);
     return(this);
 }
 public ScalarSqlExpression <X> All <X>(ScalarSqlExpression <X> expression)
 {
     return(Quantify(expression, "all"));
 }
 public ScalarSqlExpression <X> Any <X>(ScalarSqlExpression <X> expression)
 {
     return(Quantify(expression, "any"));
 }