Ai
1 Star 4 Fork 2

张勇/tauri-plugin-sql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 833 Bytes
一键复制 编辑 原始数据 按行查看 历史
// webview-src/index.ts
import { invoke } from "@tauri-apps/api/tauri";
var Database = class {
constructor(path) {
this.path = path;
}
static async load(path) {
return await invoke("plugin:sql|load", {
db: path
}).then((p) => new Database(p));
}
static get(path) {
return new Database(path);
}
async execute(query, bindValues) {
return await invoke("plugin:sql|execute", {
db: this.path,
query,
values: bindValues != null ? bindValues : []
}).then(([rowsAffected, lastInsertId]) => ({ rowsAffected, lastInsertId }));
}
async select(query, bindValues) {
return await invoke("plugin:sql|select", {
db: this.path,
query,
values: bindValues != null ? bindValues : []
});
}
};
export {
Database as default
};
//# sourceMappingURL=index.js.map
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Jackyong/tauri-plugin-sql.git
git@gitee.com:Jackyong/tauri-plugin-sql.git
Jackyong
tauri-plugin-sql
tauri-plugin-sql
dev

搜索帮助