Skip to content

Instantly share code, notes, and snippets.

@docentedev
Created June 16, 2022 02:03
Show Gist options
  • Save docentedev/e456ea9ddbb86cd8c95d7fe93e381a8f to your computer and use it in GitHub Desktop.
Save docentedev/e456ea9ddbb86cd8c95d7fe93e381a8f to your computer and use it in GitHub Desktop.

URL localhost:3001/api/v1/musicians?size=1&page=2

const query = {
  text: 'SELECT m.id, m.first_name, m.last_name, m.second_last_name, m.second_name, m.birth_date, m.death_date, m.city_fk, m.alias, c.name as city_name, co.nicename as country_name, m.image FROM musician AS m INNER JOIN city AS c ON c.id = m.city_fk INNER JOIN country AS co ON co.iso = c.country_iso_fk ORDER BY m.id desc LIMIT $2  OFFSET (($1 - 1) * $2)',
  values: [ '2', '1' ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment