INNER CODE UNIT · JavaScript

onModuleReady

joreilly/PeopleInSpace · compose-web/src/wasmJsMain/resources/sqljs.worker.js:10

function onModuleReady() {
    const data = this.data;

    switch (data && data.action) {
        case "exec":
            if (!data["sql"]) {
                throw new Error("exec: Missing query string");
            }

            return postMessage({
                id: data.id,
                results: db.exec(data.sql, data.params)[0] ?? {values: []}
            });
        case "begin_transaction":
            return postMessage({
                id: data.id,
                results: db.exec("BEGIN TRANSACTION;")
            })

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…