diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-27 14:26:13 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-27 14:26:13 +0200 |
commit | 4b3d1fd09200c09c1099a886494bf5a482f41f23 (patch) | |
tree | b5e5dde82933df2b5450ca46870dc847f099d451 | |
parent | 678ad5e109f2e5e7982b4f529a6d5fdc0e4f5c06 (diff) | |
download | FlightCore-4b3d1fd09200c09c1099a886494bf5a482f41f23.tar.gz FlightCore-4b3d1fd09200c09c1099a886494bf5a482f41f23.zip |
Move old README content to bottom of page
-rw-r--r-- | README.md | 90 |
1 files changed, 46 insertions, 44 deletions
@@ -1,47 +1,4 @@ -Source code for the [Rust Tauri Introduction Video](https://www.youtube.com/watch?v=kRoGYgAuZQE&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q) - -## Setup - -```sh -npm install -``` - -## Run - -```sh -# 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" ] } -``` - -```rs -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 - -```rs -tauri::Builder::default() - .manage(arc_db) -``` ## Roadmap @@ -106,4 +63,49 @@ npm run tauri dev Release builds are generally done via CI. To build locally, make sure typescript is compiled (`./node_modules/.bin/rollup --config`), then run `npm run tauri build`. -## Old README (to be removed) +# Old README (to be removed) + + +Source code for the [Rust Tauri Introduction Video](https://www.youtube.com/watch?v=kRoGYgAuZQE&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q) + +## Setup + +```sh +npm install +``` + +## Run + +```sh +# 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" ] } +``` + +```rs +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 + +```rs +tauri::Builder::default() + .manage(arc_db) +``` |