gocraft/dbr

Invalid syntax near OFFSET

AdamSLevy opened this issue · 5 comments

If SelectStmt.OffsetCount is >= 0 but SelectStmt.LimitCount is = -1, then OFFSET will be added to the SQL statement when interpolated.

This is invalid SQL syntax because OFFSET may only be used following a LIMIT clause.

could you create a separate PR for this? thanks!

I'm sorry but are you asking me to have a separate PR for each individual issue? Because my PR solves more than one issue... which is pretty common.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This is allowed in postgres but not in mysql, and it is a weird design choice that mysql cannot have offset without limit. The current code is good enough.