async function saveOrder(order) { db.insert(order); await new Promise(r => setTimeout(r, 2000)); // give it time return db.find(order.id); }