Example #1
0
        public bool VisitExprOrderByItem(ExprOrderByItem expr, TCtx arg)
        {
            var res = this.Visit(expr, "OrderByItem", arg, out var argOut) && this.Accept("Value", expr.Value, argOut);

            this.VisitPlainProperty("Descendant", expr.Descendant, argOut);
            this._visitor.EndVisitExpr(expr, arg);
            return(res);
        }
Example #2
0
 public bool VisitExprOrderByItem(ExprOrderByItem exprOrderByItem, IExpr?parent)
 {
     exprOrderByItem.Value.Accept(this, exprOrderByItem);
     if (exprOrderByItem.Descendant)
     {
         this.Builder.Append(" DESC");
     }
     return(true);
 }
        protected ISelectBuilder OrderByInternal(ExprOrderByItem item, params ExprOrderByItem[] rest)
        {
            if (this._orderBy.HasValue)
            {
                throw new SqExpressException("Order has already been set");
            }

            this._orderBy = new OrderByStorage(Helpers.Combine(item, rest), null);
            return(this);
        }
Example #4
0
 public static ExprOrderByItem WithDescendant(this ExprOrderByItem original, Boolean newDescendant)
 => new ExprOrderByItem(value: original.Value, descendant: newDescendant);
Example #5
0
 public static ExprOrderByItem WithValue(this ExprOrderByItem original, ExprValue newValue)
 => new ExprOrderByItem(value: newValue, descendant: original.Descendant);
 public ISelectBuilder OrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest)
 => this.OrderByInternal(item, rest);
 protected ISelectBuilder OrderByInternal(ExprOrderByItem item, params ExprOrderByItem[] rest)
 {
     this._orderItems.AssertFatalNull(nameof(this._orderItems));
     this._orderItems = Helpers.Combine(item, rest);
     return(this);
 }
Example #8
0
 public ISelectBuilder OrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest)
 {
     return(this.OrderByInternal(item, rest));
 }
Example #9
0
 public AnalyticFunctionOverFrameBuilder OverOrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest) =>
 new AnalyticFunctionOverFrameBuilder(this._name, this._arguments, this._partitions, Helpers.Combine(item, rest));
Example #10
0
 public ExprAnalyticFunction OverOrderBy(ExprOrderByItem item, params ExprOrderByItem[] rest) =>
 new ExprAnalyticFunction(new ExprFunctionName(true, this._name), this._arguments, new ExprOver(this._partitions, new ExprOrderBy(Helpers.Combine(item, rest)), null));
Example #11
0
 public static ExprSelect AddOrderBy(this IExprSubQuery original, ExprOrderByItem orderBy, params ExprOrderByItem[] rest)
 => new ExprSelect(original, new ExprOrderBy(Helpers.Combine(orderBy, rest)));