findmypast-oss / mssql_ecto

Ecto adapter for Mssqlex
Apache License 2.0
49 stars 20 forks source link

Make limit work in SQL Server 2008 by encoding it as TOP #5

Closed jbachhardie closed 7 years ago

jbachhardie commented 7 years ago

Description

Adapter now uses SELECT TOP X FROM... syntax when a limit exists without offset, rather than the OFFSET 0 ROWS FETCH NEXT X ROWS ONLY.

Motivation and Context

OFFSET/FETCH was added in SQL Server 2012 so depending on that syntax means that we couldn't have limit arguments in earlier versions despite limits without offset being supported (via TOP).

This PR closes https://github.com/findmypast-oss/mssql_ecto/issues/3

How Has This Been Tested?

Full test suite ran.

Types of changes

Checklist:

shdblowers commented 7 years ago

Hello, @jbachhardie! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.