Skip to content

format sql with dynamic limit (LIMIT ?, ?) #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rvwhitney opened this issue Jul 24, 2021 · 2 comments
Closed

format sql with dynamic limit (LIMIT ?, ?) #64

rvwhitney opened this issue Jul 24, 2021 · 2 comments
Labels

Comments

@rvwhitney
Copy link

rvwhitney commented Jul 24, 2021

as the title suggests, how to format ? so it is a number (no quotes)

@dougwilson
Copy link
Member

You need to pass in the number as a number and not as strings. Example:

console.log(SqlString.format('LIMIT ?, ?', [1, 20]))

There would only be quotes around the values if you use strings instead of numbers. I hope this helps.

@rvwhitney
Copy link
Author

immensely - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants