aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/nodes/select_core.rb
blob: bee0a5930c634f6f8340af4c643a69fde11dd448 (plain) (tree)
1
2
3
4
5
6
7

              
                                        
                                                        
                                                     
 
                    








                                                                   
         
 










                            

                               
                                               
                                         
                                    
                                    
                                               
         


       
module Arel
  module Nodes
    class SelectCore < Arel::Nodes::Node
      attr_accessor :top, :projections, :wheres, :groups
      attr_accessor :having, :source, :set_quantifier

      def initialize
        @source         = JoinSource.new nil
        @top            = nil

        # http://savage.net.au/SQL/sql-92.bnf.html#set%20quantifier
        @set_quantifier = nil
        @projections    = []
        @wheres         = []
        @groups         = []
        @having         = nil
      end

      def from
        @source.left
      end

      def from= value
        @source.left = value
      end

      alias :froms= :from=
      alias :froms :from

      def initialize_copy other
        super
        @source      = @source.clone if @source
        @projections = @projections.clone
        @wheres      = @wheres.clone
        @groups      = @groups.clone
        @having      = @having.clone if @having
      end
    end
  end
end