Class: Sequel::SQL::Window
- Inherits:
-
Expression
- Object
- Expression
- Sequel::SQL::Window
- Defined in:
- lib/sequel/sql.rb
Overview
A Window
is part of a window function specifying the window over which a window function operates.
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
The options for this window.
Instance Method Summary collapse
-
#initialize(opts = OPTS) ⇒ Window
constructor
Set the options to the options given.
Methods inherited from Expression
#==, attr_reader, #eql?, #hash, inherited, #inspect, #lit, #sql_literal
Constructor Details
#initialize(opts = OPTS) ⇒ Window
Set the options to the options given
1815 1816 1817 |
# File 'lib/sequel/sql.rb', line 1815 def initialize(opts=OPTS) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
The options for this window. Options currently supported:
- :frame
-
if specified, should be :all, :rows, or a String that is used literally. :all always operates over all rows in the partition, while :rows excludes the current row’s later peers. The default is to include all previous rows in the partition up to the current row’s last peer.
- :order
-
order on the column(s) given
- :partition
-
partition/group on the column(s) given
- :window
-
base results on a previously specified named window
1812 1813 1814 |
# File 'lib/sequel/sql.rb', line 1812 def opts @opts end |