observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
957 stars 83 forks source link

MS SQL syntax for LIMIT/OFFSET #312

Closed Sylvestre67 closed 1 year ago

Sylvestre67 commented 1 year ago

Resolves https://github.com/observablehq/projects/issues/269.

SQL server syntax for LIMIT/OFFSET type query is

ORDER BY <col> <direction>
OFFSET 0 ROWS
FETCH NEXT 1000 ROWS ONLY

The table cell is currently generating the standard SQL syntax only.

LIMIT 1000
OFFSET 0

If the source is of dialect mssql it should use the right LIMIT/OFFSET syntax.

MS SQL documentation.

Sylvestre67 commented 1 year ago

Do you mind running Prettier on the parts you’ve changed? I see some formatting nits here and I’d rather not comment on them. Thanks!

I applied the styling. prettier wants to slice any line longer than the default printWidth value of 80 char . So I ignored these changes. Hopefully this is good now.

Should we change the printWidth in the .prettierrc to something like 120 ?

mbostock commented 1 year ago

Sent #314 for your consideration. 🙏

Sylvestre67 commented 1 year ago

Sent #314 for your consideration. 🙏

Merged. Thanks a lot !