Sequel does not support OFFSET clauses (patch included) #33

Closed
jeremyevans opened this Issue May 1, 2011 · 2 comments

Projects

None yet

1 participant

@jeremyevans
Owner

Neither LIMIT or OFFSET are (to my knowledge) in the SQL standard, but they
are supported across all databases with existing adaptors in Sequel. An
OFFSET is only valid is specified with a LIMIT, so it would not sensible to
provide a separate method for it (it would be confusing to the user).

There are two common forms of supported LIMIT and OFFSET, either LIMIT x
OFFSET y or LIMIT offset, limit. I think it would be confusing to have a
Dataset#limit(x, y) where x is sometimes the limit and sometimes the
offset. It would perhaps be nice to use Ruby's array slicing semantics, so
dset[4] will perform a suitable query and give you the result immediately
much like #first, dset[4..4] will not. dset[offset, lim] would be a natural
alternate representation like with Ruby's Array. I haven't tried to make
Dataset#[] behave this way. I'm unconvinced of the current behaviour of
that method. Perhaps it makes sense as an alias to where, but I don't see
how it makes sense to return the first result.

Google Code Info:
Issue #: 3
Author: asbradb...@gmail.com
Created On: 2007-04-08T15:11:52.000Z
Closed On: 2007-04-08T16:40:42.000Z

@jeremyevans jeremyevans was assigned May 1, 2011
@jeremyevans jeremyevans closed this May 1, 2011
@jeremyevans
Owner

Again, didn't include documentation. Fixed.

Google Code Info:
Author: asbradb...@gmail.com
Created On: 2007-04-08T16:37:53.000Z

@jeremyevans
Owner

Fixed in trunk. Thanks...

Google Code Info:
Author: cico...@gmail.com
Created On: 2007-04-08T16:40:42.000Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment