Class Sequel::SQL::Subscript
In: lib/sequel_core/sql.rb
Parent: GenericExpression

Represents an SQL array access, with multiple possible arguments.

Methods

new   to_s   |  

Attributes

f  [R]  The SQL array column
sub  [R]  The array of subscripts to use (should be an array of numbers)

Public Class methods

Set the attributes to the given arguments

[Source]

     # File lib/sequel_core/sql.rb, line 797
797:       def initialize(f, sub)
798:         @f, @sub = f, sub
799:       end

Public Instance methods

Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.

[Source]

     # File lib/sequel_core/sql.rb, line 809
809:       def to_s(ds)
810:         ds.subscript_sql(self)
811:       end

Create a new subscript appending the given subscript(s) the the current array of subscripts.

[Source]

     # File lib/sequel_core/sql.rb, line 803
803:       def |(sub)
804:         Subscript.new(@f, @sub + Array(sub))
805:       end

[Validate]