mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
36 lines
1005 B
JavaScript
36 lines
1005 B
JavaScript
/*
|
|
2022-05-23
|
|
|
|
The author disclaims copyright to this source code. In place of a
|
|
legal notice, here is a blessing:
|
|
|
|
* May you do good and not evil.
|
|
* May you find forgiveness for yourself and forgive others.
|
|
* May you share freely, never taking more than you give.
|
|
|
|
***********************************************************************
|
|
|
|
UNDER CONSTRUCTION
|
|
|
|
This is a JS Worker file for the main sqlite3 api. It loads
|
|
sqlite3.js and offers access to the db via the Worker
|
|
message-passing interface.
|
|
*/
|
|
|
|
"use strict";
|
|
(function(){
|
|
/** Posts a worker message as {type:type, data:data}. */
|
|
const wMsg = (type,data)=>self.postMessage({type, data});
|
|
self.onmessage = function(ev){
|
|
/*ev = ev.data;
|
|
switch(ev.type){
|
|
default: break;
|
|
};*/
|
|
console.warn("Unknown sqlite3-worker message type:",ev);
|
|
};
|
|
importScripts('sqlite3.js');
|
|
initSqlite3Module().then(function(){
|
|
wMsg('sqlite3-api','ready');
|
|
});
|
|
})();
|