[GH-ISSUE #61] Paging does not work with MSSQL #42

Closed
opened 2026-02-26 01:32:58 +03:00 by kerem · 4 comments
Owner

Originally created by @knutimar on GitHub (May 16, 2017).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/61

Originally assigned to: @jeffknupp on GitHub.

http://localhost:5000/bigtable/?page=1 works
http://localhost:5000/bigtable/?page=2 gives 500 Internal Server Error

....
sql/base.py", line 1169, in visit_select
raise exc.CompileError('MSSQL requires an order_by when '
CompileError: MSSQL requires an order_by when using an OFFSET or a non-simple LIMIT clause

I am using sandman2 v1.0.6 and Python 2.7.12 on Linux
Connection string starts with mssql+pymssql://

Originally created by @knutimar on GitHub (May 16, 2017). Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/61 Originally assigned to: @jeffknupp on GitHub. http://localhost:5000/bigtable/?page=1 works http://localhost:5000/bigtable/?page=2 gives 500 Internal Server Error .... sql/base.py", line 1169, in visit_select raise exc.CompileError('MSSQL requires an order_by when ' CompileError: MSSQL requires an order_by when using an OFFSET or a non-simple LIMIT clause I am using sandman2 v1.0.6 and Python 2.7.12 on Linux Connection string starts with mssql+pymssql://
kerem 2026-02-26 01:32:58 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jeffknupp commented on GitHub (May 16, 2017):

Well, the error seems clear and makes sense. Let me see what I can do. Unfortunately, I don't have an MSSQL database to test on, but it should work on any database.

<!-- gh-comment-id:301783049 --> @jeffknupp commented on GitHub (May 16, 2017): Well, the error seems clear and makes sense. Let me see what I can do. Unfortunately, I don't have an MSSQL database to test on, but it should work on any database.
Author
Owner

@jeffknupp commented on GitHub (May 16, 2017):

@knutimar In the meantime, can you try to circumvent this by simply adding /?sort=<some attribute of your model>&page=2 and let me know the output?

<!-- gh-comment-id:301789777 --> @jeffknupp commented on GitHub (May 16, 2017): @knutimar In the meantime, can you try to circumvent this by simply adding `/?sort=<some attribute of your model>&page=2` and let me know the output?
Author
Owner

@knutimar commented on GitHub (May 17, 2017):

Hi, thanks for your reply.
The workaround with adding /?sort=&page=2 works
fine, thank you!
I tried several increments for page=x and every time I get 20 new elements.

2017-05-16 15:55 GMT+02:00 Jeff Knupp notifications@github.com:

@knutimar https://github.com/knutimar In the meantime, can you try to
circumvent this by simply adding /?sort=&page=2 and let me know the output?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jeffknupp/sandman2/issues/61#issuecomment-301789777,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGvZH-HP5L6SP7awGHmliVES7nuoJfMUks5r6aq6gaJpZM4NcLOU
.

<!-- gh-comment-id:301980362 --> @knutimar commented on GitHub (May 17, 2017): Hi, thanks for your reply. The workaround with adding /?sort=<some attribute of your model>&page=2 works fine, thank you! I tried several increments for page=x and every time I get 20 new elements. 2017-05-16 15:55 GMT+02:00 Jeff Knupp <notifications@github.com>: > @knutimar <https://github.com/knutimar> In the meantime, can you try to > circumvent this by simply adding /?sort=<some attribute of your > model>&page=2 and let me know the output? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/jeffknupp/sandman2/issues/61#issuecomment-301789777>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AGvZH-HP5L6SP7awGHmliVES7nuoJfMUks5r6aq6gaJpZM4NcLOU> > . >
Author
Owner

@jeffknupp commented on GitHub (May 18, 2017):

20 is just the default. If you'd like to change the number returned per page, set the limit URL parameter

<!-- gh-comment-id:302418490 --> @jeffknupp commented on GitHub (May 18, 2017): 20 is just the default. If you'd like to change the number returned per page, set the `limit` URL parameter
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/sandman2-jeffknupp#42
No description provided.