Skip to content
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

Week3 Exercise 3 improvements #476

Open
tomasvanrijsse opened this issue Mar 8, 2021 · 0 comments
Open

Week3 Exercise 3 improvements #476

tomasvanrijsse opened this issue Mar 8, 2021 · 0 comments

Comments

@tomasvanrijsse
Copy link
Contributor

tomasvanrijsse commented Mar 8, 2021

By week 3 the students are used to work with the promisified execQuery.

The exercise could be upgraded so there are less questions about the weirdness / old school approach.

const execQuery = util.promisify(connection.query.bind(connection));

async function getPopulationFromCountry(name, code) {
  // assuming that connection to the database is established and stored as conn
  return execQuery(
    `SELECT Population FROM `country` WHERE Name = '${name}' and code = '${code}'`
  );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant