-
Notifications
You must be signed in to change notification settings - Fork 6
Igor w4 databases #28
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
base: main
Are you sure you want to change the base?
Conversation
yunchen4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only a small suggestion to improve performance.
| try { | ||
| // Test total population for Netherlands | ||
| const countryResult = await getTotalPopulationByCountry('Netherlands'); | ||
| console.log('Total Population for Netherlands:'); | ||
| console.log(JSON.stringify(countryResult, null, 2)); | ||
|
|
||
| // Test continent data for Year 2020, Age 100+ | ||
| const continentResult = await getContinentDataByYearAndAge(2020, '100+'); | ||
| console.log('\nContinent Data for Year 2020, Age 100+:'); | ||
| console.log(JSON.stringify(continentResult, null, 2)); | ||
| } catch (err) { | ||
| console.error('Error in main:', err); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Since you will call both functions in this function, you can move DB client initialization and closing in the main rather than in each function. This can reduce the overhead of initializing and closing DB connections.
No description provided.