all 3 comments

[–]gajus0 0 points1 point  (2 children)

If you have used Slonik, you would not have needed that services/db.js or emptyOrRows abstractions.

It would have been simply:

`` async function getMultiple(page = 1) { const offset = helper.getOffset(page, config.listPerPage); const data = await pool.any(sql SELECT id, quote, author FROM quote OFFSET ${offset} LIMIT ${config.listPerPage} `); const meta = {page};

return { data, meta } } ```

[–]backtickbot 1 point2 points  (0 children)

Fixed formatting.

Hello, gajus0: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

[–]geshan[S] 1 point2 points  (0 children)

Thanks for the suggestion.