Class: Sequel::SQL::Window

Inherits:
Expression show all
Defined in:
lib/sequel/lib/sequel/sql.rb

Overview

A window is part of a window function specifying the window over which the function operates. It is separated from the WindowFunction class because it also can be used separately on some databases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#lit

Constructor Details

#initialize(opts = {}) ⇒ Window

Set the options to the options given


912
913
914
# File 'lib/sequel/lib/sequel/sql.rb', line 912

def initialize(opts={})
  @opts = opts
end

Instance Attribute Details

#optsObject (readonly)

The options for this window. Options currently used are:

  • :frame - if specified, should be :all or :rows. :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


909
910
911
# File 'lib/sequel/lib/sequel/sql.rb', line 909

def opts
  @opts
end