public override ISqlNode VisitBetween(SqlBetweenOperationNode n)
 {
     _result.AssertIsScalarExpression(n, nameof(n.Left), n.Left);
     _result.AssertIsScalarExpression(n, nameof(n.Low), n.Low);
     _result.AssertIsScalarExpression(n, nameof(n.High), n.High);
     return(base.VisitBetween(n));
 }
Ejemplo n.º 2
0
        public virtual ISqlNode VisitBetween(SqlBetweenOperationNode n)
        {
            var left = Visit(n.Left);
            var low  = Visit(n.Low);
            var high = Visit(n.High);

            return(n.Update(n.Not, left, low, high));
        }
Ejemplo n.º 3
0
        public void Validate_Between()
        {
            var ast = new SqlBetweenOperationNode
            {
                Left = new SqlIdentifierNode("a"),
                Low  = new SqlNumberNode(5),
                High = new SqlKeywordNode("MAX")
            };
            var result = ast.Validate();

            result.Passed.Should().BeFalse();

            ast = new SqlBetweenOperationNode
            {
                Left = new SqlIdentifierNode("a"),
                Low  = new SqlNumberNode(5),
                High = new SqlNumberNode(7)
            };
            ast.Validate().Passed.Should().BeTrue();
        }
Ejemplo n.º 4
0
 public ISqlNode VisitBetween(SqlBetweenOperationNode n)
 {
     Append(n.Left, n.Not ? " NOT" : "", " BETWEEN ", n.Low, " AND ", n.High);
     return(n);
 }