예제 #1
0
        public override string BuildSql(SqlOptions sqlOptions)
        {
            var operand = Operand.BuildSql(sqlOptions, FlowOptions.Construct(this));
            var command = sqlOptions.Command("IS NULL");

            return($"{operand} {command}");
        }
예제 #2
0
        public override string BuildSql(SqlOptions sqlOptions)
        {
            var operand = Operand.BuildSql(sqlOptions, FlowOptions.Construct(this));
            var command = new FalseOperand().BuildSql(sqlOptions, FlowOptions.Construct(this));

            return($"{operand} = {command}");
        }
예제 #3
0
        public override string BuildSql(SqlOptions sqlOptions)
        {
            var left    = LeftOperand.BuildSql(sqlOptions, FlowOptions.Construct(this));
            var right   = RightOperand.BuildSql(sqlOptions, FlowOptions.Construct(this));
            var command = sqlOptions.Command("LIKE");

            return($"{left} {command} {right}");
        }
예제 #4
0
        public override string BuildSql(SqlOptions sqlOptions)
        {
            var operators =
                Entities.Select(o => o.BuildSql(sqlOptions, FlowOptions.Construct(this)));
            var command    = sqlOptions.Command(Command);
            var separator  = GetSeparator(sqlOptions);
            var conditions = string.Join($"{separator}{command} ", operators);

            return($"{conditions}");
        }
예제 #5
0
        public override string BuildSql(SqlOptions sqlOptions)
        {
            var left  = LeftOperand.BuildSql(sqlOptions, FlowOptions.Construct(this));
            var right = RightOperand.BuildSql(sqlOptions, FlowOptions.Construct(this));

            switch (sqlOptions.DatabaseType)
            {
            case SqlDatabaseType.Postgres:
                return($"{left} = {sqlOptions.Command("ANY")}({right})");

            default:
                return($"{left} {sqlOptions.Command("IN")} ({right})");
            }
        }
예제 #6
0
        public override string BuildSql(SqlOptions sqlOptions)
        {
            switch (sqlOptions.DatabaseType)
            {
            case SqlDatabaseType.Postgres:
            {
                var left    = LeftOperand.BuildSql(sqlOptions, FlowOptions.Construct(this));
                var right   = RightOperand.BuildSql(sqlOptions, FlowOptions.Construct(this));
                var command = sqlOptions.Command("ILIKE");
                return($"{left} {command} {right}");
            }

            default:
            {
                return(new LikeOperator(LeftOperand.Lower(), RightOperand.Lower()).BuildSql(sqlOptions, FlowOptions.Construct(this)));
            }
            }
        }