tauri-plugin-pulsify
Local persistence for Pulsify
documents in Tauri 2 apps, desktop and mobile. The plugin keeps a SQLite
database in the app process; the webview talks to it through the local
connector of the @pulsify/tauri
npm package.
- Local first: documents load from disk before the network answers, and edits made offline are stored immediately.
- One writer: every window shares one SQLite connection; rows saved by one window reach the others live.
- Same file format as the TypeScript
SqlitePatchStore: either side can open a database written by the other. - Binary IPC: frames travel as raw bytes (
tauri::ipc::Request/Channel), never as JSON arrays.
Setup
# src-tauri/Cargo.toml
[]
= "6"
// src-tauri/src/lib.rs
default
.plugin
.run
.expect;
Grant the commands to your windows in a capability:
// src-tauri/capabilities/default.json
pulsify:default allows open, send and close; pulsify:allow-open, …
grant them one by one.
In the webview:
import { createTauriConnector } from "@pulsify/tauri";
import { loadPulse } from "@pulsify/core";
const notebook = await loadPulse(Notebook, userId, {
connectors: [createTauriConnector(), remote],
include: true,
});
Database
The default file is pulsify.sqlite in the app data directory, opened in WAL
mode with synchronous=FULL: rows are durable before they are acknowledged.
Choose another file with the builder:
new.path.build
The store itself, without Tauri, is the
pulsify-sqlite crate.
License
Apache-2.0