Using withCache
const myFriends: CacheMap<{ name: string; age: number }> = {}
async function fetchMyFriendsFromCity(fromCity: string) {
// This is to preserve the name of the function in the stack trace
const fetchMyFriendsFromCity = async () => {
console.log('Fetching my friends from the database...')
return (await db.query('SELECT * FROM friends WHERE city = ?', [fromCity])).rows