示例#1
0
        public bool VisitExprSelect(ExprSelect expr, TCtx arg)
        {
            var res = this.Visit(expr, "Select", arg, out var argOut) && this.Accept("SelectQuery", expr.SelectQuery, argOut) && this.Accept("OrderBy", expr.OrderBy, argOut);

            this._visitor.EndVisitExpr(expr, arg);
            return(res);
        }
示例#2
0
        public bool VisitExprSelect(ExprSelect exprSelect, IExpr?parent)
        {
            exprSelect.SelectQuery.Accept(this, exprSelect);
            this.Builder.Append(" ORDER BY ");
            exprSelect.OrderBy.Accept(this, exprSelect);

            if (exprSelect.SelectQuery is ExprQuerySpecification specification)
            {
                if (!ReferenceEquals(specification.Top, null))
                {
                    this.AppendSelectLimit(specification.Top, exprSelect);
                }
            }

            return(true);
        }
示例#3
0
 public static ExprSelect WithCrossJoin(this ExprSelect select, IExprTableSource tableSource)
 => select.SelectQuery is ExprQuerySpecification specification
示例#4
0
 public static ExprSelect WithFullJoin(this ExprSelect select, IExprTableSource tableSource, ExprBoolean on)
 => select.SelectQuery is ExprQuerySpecification specification
示例#5
0
 public static ExprSelect WithOrderBy(this ExprSelect original, ExprOrderBy newOrderBy)
 => new ExprSelect(selectQuery: original.SelectQuery, orderBy: newOrderBy);
示例#6
0
 public static ExprSelect WithSelectQuery(this ExprSelect original, IExprSubQuery newSelectQuery)
 => new ExprSelect(selectQuery: newSelectQuery, orderBy: original.OrderBy);
示例#7
0
 public static ExprSelectOffsetFetch AddOffsetFetch(this ExprSelect original, int offset, int?fetch)
 => new ExprSelectOffsetFetch(original.SelectQuery,
                              new ExprOrderByOffsetFetch(original.OrderBy.OrderList,
                                                         new ExprOffsetFetch(offset, fetch.HasValue ? new ExprInt32Literal(fetch) : null)));