Skip to content

YoungHaKim7/rust-tauri-intro

 
 

Repository files navigation

Source code for the Rust Tauri Introduction Video

Setup

npm install

Run

# terminal 1 (UI localhost for hot-reload)
npm run ui-dev

# terminal 2 (for the Rust/App hot-reload)
npm run tauri dev

Database Pool as state

Rather to have a simple Mutex for the state, database can be used.

sqlx = { version = "0.6", features = [ "runtime-tokio-rustls", "postgres" ] }
let con_string = format!("postgres://postgres:postgres@localhost/postgres");
let db = PgPoolOptions::new()
	.max_connections(5)
	.connect(&con_string)
	.await
	.expect("Cannot create PgPool");

let arc_db = Arc::new(db);

Then

tauri::Builder::default()
	.manage(arc_db)

tauri debugging(VScode)

https://tauri.app/v1/guides/debugging/vs-code/

About

Rust Tauri Introduction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 40.5%
  • Rust 36.8%
  • JavaScript 22.7%