docs.rs failed to build tauri-plugin-sqlite-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Tauri Plugin sqlite
Tauri plugin for sqlite database based on Sqlx
- Consistent with the official sql plugin api, but only supports sqlite
- Support Sqlite extension
Installation
Rust
Webview
# or
Usage
Initalize plugin
Configure plugin in tauri.conf.json:
Migration in rust
use ;
Frontend api
import { load, execute, select, close } from 'tauri-plugin-sqlite-api';
// load database
const db = await load({
db_url: 'sqlite:test.db'
});
// execute
const result = await execute(db, 'INSERT INTO users (name) VALUES (?)', ['John']);
console.log(result); // { rowsAffected: 1, lastInsertId: 1 }
// select
const rows = await select(db, 'SELECT * FROM users WHERE name = ?', ['John']);
console.log(rows); // [{ id: 1, name: 'John' }]
// close
await close(db);