Sep 7, 2018 · 1 min read
You mention the necessity to use LegacySQL due to the lack of support of Promises in StandardSQL. I would suggest obviating the need for supporting Promises by simply using the synchronous approach to instantiating a WebAssembly instance.
The result will simply change the last few lines of the UDF:
const module = new WebAssembly.Module(bytes);
const instance = new WebAssembly.Instance(module, imports);
const exports = instance.exports;
const sum = exports._sum;Great posts by you and Francesc!
