axemclion/IndexedDBShim — pull request #24 by pixelcort (2012-08-16 22:31:24+00:00)
Title: Fix #19 get continue working when providing key

Currently, calling ```continue``` with a key is not working. This fixes it in the following ways:

* The SQL generated was invalid; a ```WHERE``` clause was being appended after the ```ORDER BY``` clause.
* The SQL generated was invalid when there was no range filtering, an additional ```WHERE``` clause would be added. (There is always a ```WHERE``` clause added earlier to do a null check on they column.)
* The key filtering should be on the relevant column, not they ```key``` column.
* The key should be stored and the offset reset, so that future calls to ```continue``` can keep moving forward.
* The check should be a ```>=``` for two reasons:
1. If the key is not found, the cursor should return the next found item instead.
2. This allows calling ```continue``` again later, using the newly reset offset and last used key.

This is a fairly involved commit to a codebase I'm not too familiar; I would love a pair of eyes on it before integration.

Thanks!