Skip to main content

Tauri

This backend uses tauri-plugin-sqlite.

Installation

Edit src-tauri/Cargo.toml:

[dependencies.tauri-plugin-sqlite]
git = "https://github.com/lzdyes/tauri-plugin-sqlite"
tag = "v0.1.0"

Edit src-tauri/src/main.rs:

fn main() {
let context = tauri::generate_context!();
tauri::Builder::default()
.plugin(tauri_plugin_sqlite::init())
.run(context)
.expect("error while running tauri application");
}

Install Kikko packages:

yarn add @kikko-land/sql.js @kikko-land/tauri-backend

Configure Kikko:

import { tauriBackend } from "@kikko-land/tauri-backend";

const config: IInitDbClientConfig = {
dbName: "helloWorld",
dbBackend: tauriBackend((dbName) => `${dbName}.db`),
plugins: [migrationsPlugin({ migrations: [] }), reactiveQueriesPlugin()],
};

Usage example repo: https://github.com/kikko-land/kikko-tauri-example