protected virtual string CompileCondition(WhereCondition condition, SqlCompilerContext context) { return(condition switch { CompareColumnsCondition compareColumnsCondition => CompileCondition(compareColumnsCondition, context), CompareCondition compareCondition => CompileCondition(compareCondition, context), InCondition inCondition => CompileCondition(inCondition, context), NestedCondition nestedCondition => CompileCondition(nestedCondition, context), RawCondition rawCondition => CompileCondition(rawCondition, context), _ => throw new ArgumentOutOfRangeException(nameof(condition)) });
protected virtual string CompileNestedCondition <Q>(NestedCondition <Q> x) where Q : BaseQuery <Q> { if (!x.Query.HasComponent("where", EngineCode)) { return(null); } var sql = CompileConditions(x.Query.GetComponents <AbstractCondition>("where", EngineCode)); var op = x.IsNot ? "NOT " : ""; return($"{op}({sql})"); }
protected virtual string CompileNestedCondition <Q>(SqlResult ctx, NestedCondition <Q> x) where Q : BaseQuery <Q> { if (!x.Query.HasComponent("where", EngineCode)) { return(null); } var clauses = x.Query.GetComponents <AbstractCondition>("where", EngineCode); var sql = CompileConditions(ctx, clauses); return(x.IsNot ? $"NOT ({sql})" : $"({sql})"); }
private void Start() { SetStartupPosition(); targetFov = option.DefaultFov; direction = -1; swipeConditions = new NestedCondition(); swipeConditions.Conditions += delegate { return(CrossInput.CurrentState == CrossInput.PointerState.Swipe && !EventSystem.IsPointerDownOverUI); }; }
protected virtual string CompileNestedCondition <Q>(SqlResult ctx, NestedCondition <Q> x) where Q : BaseQuery <Q> { if (!x.Query.HasComponent("where", EngineCode)) { return(null); } var sql = CompileConditions(ctx, x.Query.GetComponents <AbstractCondition>("where", EngineCode)); var op = x.IsNot ? "NOT " : ""; return(string.IsNullOrEmpty(sql) ? "" : $"{op}({sql})"); }
public Query BuildFrom(string query, Query from) { var build = this.Build(query); var nested = new NestedCondition <Query> { Component = "where", Query = new Query() }; nested.Query.Clauses.AddRange(build.Clauses); from.Clauses.Add(nested); return(from); }
public Query Parenthesize(Query expression) { var nested = new NestedCondition <Query> { Component = "where", Query = new Query() }; nested.Query.Clauses.AddRange(expression.Clauses); var q = new Query(); q.Clauses.Add(nested); return(q); }
public WhereBuilder Grouped(Action <WhereBuilder> where) { if (where == null) { throw new ArgumentNullException(nameof(where)); } var conditions = new List <WhereCondition>(); var nestedCondition = new NestedCondition(conditions); var nestedBuilder = new WhereBuilder(Table, conditions); AddCondition(nestedCondition); where (nestedBuilder); return(this); }
private void Awake() { selectConditions = new NestedCondition(); selectConditions.Conditions += delegate { return(CrossInput.IsTouch && !EventSystem.IsPointerDownOverUI); }; selectConditions.Conditions += delegate { return(CameraController.Gesture == EnumCollect.CameraGesture.None); }; SelectedCallback += UpdateCursor; SelectedCallback += DetermineSelectedOnRSS; }
private void InitSelectCondition() { selectCondition = new NestedCondition(); selectCondition.Conditions += delegate { return(CrossInput.IsPointerUp); }; selectCondition.Conditions += delegate { return(Window.activeInHierarchy); }; selectCondition.Conditions += delegate { return(openAtFrame != Time.frameCount); }; }