Module: Sequel::SQL::SubscriptMethods

Included in:
ComplexExpression, GenericComplexExpression, GenericExpression, Symbol
Defined in:
lib/sequel/lib/sequel/sql.rb

Overview

Methods that create Subscripts (SQL array accesses).

Instance Method Summary collapse

Instance Method Details

#sql_subscript(*sub) ⇒ Object

Return an SQL array subscript with the given arguments.

:array.sql_subscript(1) # SQL: array[1]
:array.sql_subscript(1, 2) # SQL: array[1, 2]

367
368
369
# File 'lib/sequel/lib/sequel/sql.rb', line 367

def sql_subscript(*sub)
  Subscript.new(self, sub.flatten)
end