Module: Sequel::SQL::SubscriptMethods
- Included in:
- ComplexExpression, GenericExpression, StringAgg, Symbol
- Defined in:
- lib/sequel/sql.rb
Overview
This module includes the sql_subscript
method, representing SQL array accesses.
Instance Method Summary collapse
-
#sql_subscript(*sub) ⇒ Object
Return a
Subscript
with the given arguments, representing an SQL array access.
Instance Method Details
#sql_subscript(*sub) ⇒ Object
Return a Subscript
with the given arguments, representing an SQL array access.
:array.sql_subscript(1) # array[1]
:array.sql_subscript(1, 2) # array[1, 2]
:array.sql_subscript([1, 2]) # array[1, 2]
:array.sql_subscript(:array, 1..2) # array[1:2]
:array.sql_subscript(:array, 1...3) # array[1:2]
993 994 995 |
# File 'lib/sequel/sql.rb', line 993 def sql_subscript(*sub) Subscript.new(self, sub.flatten) end |