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); }
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); }
public static ExprSelect WithCrossJoin(this ExprSelect select, IExprTableSource tableSource) => select.SelectQuery is ExprQuerySpecification specification
public static ExprSelect WithFullJoin(this ExprSelect select, IExprTableSource tableSource, ExprBoolean on) => select.SelectQuery is ExprQuerySpecification specification
public static ExprSelect WithOrderBy(this ExprSelect original, ExprOrderBy newOrderBy) => new ExprSelect(selectQuery: original.SelectQuery, orderBy: newOrderBy);
public static ExprSelect WithSelectQuery(this ExprSelect original, IExprSubQuery newSelectQuery) => new ExprSelect(selectQuery: newSelectQuery, orderBy: original.OrderBy);
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)));