Method: Sequel::Dataset#offset
- Defined in:
- lib/sequel/dataset/query.rb
permalink #offset(o) ⇒ Object
Returns a copy of the dataset with a specified order. Can be safely combined with limit. If you call limit with an offset, it will override the offset if you’ve called offset first.
DB[:items].offset(10) # SELECT * FROM items OFFSET 10
772 773 774 775 776 777 778 |
# File 'lib/sequel/dataset/query.rb', line 772 def offset(o) o = o.to_i if o.is_a?(String) && !o.is_a?(LiteralString) if o.is_a?(Integer) raise(Error, 'Offsets must be greater than or equal to 0') unless o >= 0 end clone(:offset => o) end |