2010-08-12 19:19:54 -04:00
|
|
|
module Arel
|
|
|
|
module Nodes
|
2010-11-29 18:23:58 -05:00
|
|
|
class SelectCore < Arel::Nodes::Node
|
2011-01-03 13:31:25 -05:00
|
|
|
attr_accessor :top, :projections, :wheres, :groups
|
2011-04-21 16:28:21 -04:00
|
|
|
attr_accessor :having, :source, :set_quantifier
|
2010-12-07 17:20:30 -05:00
|
|
|
|
2010-08-12 19:19:54 -04:00
|
|
|
def initialize
|
2011-04-21 16:28:21 -04:00
|
|
|
@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
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
2010-08-19 01:30:36 -04:00
|
|
|
|
2010-12-14 12:43:19 -05:00
|
|
|
def from
|
|
|
|
@source.left
|
|
|
|
end
|
|
|
|
|
|
|
|
def from= value
|
|
|
|
@source.left = value
|
|
|
|
end
|
|
|
|
|
|
|
|
alias :froms= :from=
|
|
|
|
alias :froms :from
|
|
|
|
|
2010-08-19 01:30:36 -04:00
|
|
|
def initialize_copy other
|
|
|
|
super
|
2010-12-14 12:43:19 -05:00
|
|
|
@source = @source.clone if @source
|
2010-08-30 18:35:13 -04:00
|
|
|
@projections = @projections.clone
|
2010-09-07 18:47:38 -04:00
|
|
|
@wheres = @wheres.clone
|
2010-12-21 13:51:28 -05:00
|
|
|
@groups = @groups.clone
|
2010-09-08 18:29:22 -04:00
|
|
|
@having = @having.clone if @having
|
2010-08-19 01:30:36 -04:00
|
|
|
end
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|