This commit is contained in:
parent
dfbf923d04
commit
0252fb337d
2 changed files with 10 additions and 2 deletions
|
@ -32,10 +32,14 @@ async function init() {
|
||||||
|
|
||||||
rpcProvider.signal("db", { status: DbStatusCode.LOADED_SQLITE });
|
rpcProvider.signal("db", { status: DbStatusCode.LOADED_SQLITE });
|
||||||
|
|
||||||
|
console.log("new SQLITEFS", SQLiteFS, SQL, IndexedDBBackend);
|
||||||
const sqlFS = new SQLiteFS(SQL.FS, new IndexedDBBackend());
|
const sqlFS = new SQLiteFS(SQL.FS, new IndexedDBBackend());
|
||||||
|
console.log("REGISTER FOR IDB", sqlFS);
|
||||||
SQL.register_for_idb(sqlFS);
|
SQL.register_for_idb(sqlFS);
|
||||||
|
|
||||||
|
console.log("MKDIR SQL");
|
||||||
SQL.FS.mkdir("/sql");
|
SQL.FS.mkdir("/sql");
|
||||||
|
console.log("MOUNT SQLFS");
|
||||||
SQL.FS.mount(sqlFS, {}, "/sql");
|
SQL.FS.mount(sqlFS, {}, "/sql");
|
||||||
|
|
||||||
const path = "/sql/db.sqlite";
|
const path = "/sql/db.sqlite";
|
||||||
|
@ -45,8 +49,12 @@ async function init() {
|
||||||
SQL.FS.close(stream);
|
SQL.FS.close(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
globalThis.SQL = SQL;
|
||||||
|
console.log("OPEN DB", SQL);
|
||||||
const db: Database = new SQL.Database(path, { filename: true });
|
const db: Database = new SQL.Database(path, { filename: true });
|
||||||
db.exec("PRAGMA journal_mode=MEMORY;");
|
console.log("RUN PRAGMA");
|
||||||
|
db.run("PRAGMA journal_mode=MEMORY");
|
||||||
|
console.log("DONE");
|
||||||
|
|
||||||
rpcProvider.signal("db", { status: DbStatusCode.OPENED_DATABASE });
|
rpcProvider.signal("db", { status: DbStatusCode.OPENED_DATABASE });
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ const baseUrls = {
|
||||||
|
|
||||||
export default defineConfig(({ mode }) => ({
|
export default defineConfig(({ mode }) => ({
|
||||||
base: baseUrls[mode],
|
base: baseUrls[mode],
|
||||||
build: {},
|
build: { sourcemap: true },
|
||||||
server: {
|
server: {
|
||||||
https: {},
|
https: {},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue