This commit is contained in:
parent 56d2b9cae0
commit 481331b494
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -1,28 +1,16 @@
import { import {
App,
Editor,
MarkdownView,
Modal,
Notice, Notice,
Plugin, Plugin,
PluginSettingTab,
Setting,
} from "obsidian"; } from "obsidian";
import TestWorker from "sqlite3.worker"; import TestWorker from "sqlite3.worker";
import { sqlite3Worker1Promiser } from "@sqlite.org/sqlite-wasm"; import { sqlite3Worker1Promiser } from "@sqlite.org/sqlite-wasm";
// Remember to rename these classes and interfaces! // Remember to rename these classes and interfaces!
interface MyPluginSettings {
mySetting: string;
}
const DEFAULT_SETTINGS: MyPluginSettings = {
mySetting: "default",
};
export default class MyPlugin extends Plugin { export default class MyPlugin extends Plugin {
settings: MyPluginSettings; settings: any;
private worker: Worker; private worker: Worker;
private promiser: (...args: any[]) => any; private promiser: (...args: any[]) => any;
@ -39,7 +27,7 @@ export default class MyPlugin extends Plugin {
} }
async loadSettings() { async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); this.settings = Object.assign({}, await this.loadData());
} }
async saveSettings() { async saveSettings() {
@ -114,22 +102,5 @@ export default class MyPlugin extends Plugin {
} finally { } finally {
await this.promiser("close", { dbId }); await this.promiser("close", { dbId });
} }
// db = new sqlite3.oo1.DB("/test.sqlite3", "ct");
/* if (db) {
try {
console.log("Creating a table...");
db.exec();
console.log("Insert some data using exec()...");
for (let i = 20; i <= 25; ++i) {
db.exec({
sql: "INSERT INTO t(a,b) VALUES (?,?)",
bind: [i, i * 2],
});
}
db.exec();
} finally {
db.close();
}
} */
} }
} }