Awesome
Native DB + Tauri V2 + Vanilla
This is a simple example of a Tauri app using a native_db
.
Key points:
- Define an api: 1 model
Person
with 2 versions, source lib.rs#L8-L51. - Use
native_db
as a Tauri managed state, source lib.rs#L61-L85. - Migrate the database during the app setup, source lib.rs#L115-L122.
How to use it?
It's super simple:
- Prerequisites:
- Have Rust and Cargo installed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Have Tauri CLI installed
cargo install tauri-cli
- Clone the repository
git clone https://github.com/vincent-herlemont/native_db_tauri_vanilla.git
# Navigate to the project folder
cd native_db_tauri_vanilla/
- Run the project
cargo tauri dev
There you go!