Most of the articles mention that await
is a replacement for then
. However, I can't find a way to do the approach below by using await
since it will defer execution until run query
finishes. Just curious, is there a way?
this.database
.run(query, bindings)
.then(result => this.ws.send(result))
.catch(err => this.ws.error(err));
return reply.code(202).send();