Sha256: a1b6d2a7679fdd0601eb4da8138345ac7aac0d4923ec3d2a66dae18b49b2617e

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

module Alf
  module Sql
    module SetOperator
      include Expr

      def left
        self[2]
      end

      def right
        self[3]
      end

      def set_quantifier
        self[1]
      end

      def with_exp?
        false
      end

      def set_operator?
        true
      end

      def is_table_dee?
        false
      end

      def distinct?
        set_quantifier.distinct?
      end

      def all?
        set_quantifier.all?
      end

      def should_be_reused?
        true
      end

      def order_by_clause
        nil
      end

      def to_attr_list
        self.last.to_attr_list
      end

      def to_sql(buffer = "", parenthesize = !buffer.empty?)
        if parenthesize
          sql_parenthesized(buffer){|b| to_sql(b, false) }
        else
          left.to_sql(buffer, true)
          buffer << SPACE << keyword
          unless distinct?
            buffer << SPACE
            set_quantifier.to_sql(buffer)
          end
          buffer << SPACE
          right.to_sql(buffer, true)
          buffer
        end
      end

    end # module SetOperator
  end # module Sql
end # module Alf

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-sql-0.16.3 lib/alf/sql/nodes/set_operator.rb
alf-sql-0.16.2 lib/alf/sql/nodes/set_operator.rb
alf-sql-0.16.1 lib/alf/sql/nodes/set_operator.rb
alf-sql-0.16.0 lib/alf/sql/nodes/set_operator.rb