833114372a
* wip: changes to surb logic + stronger db typing * surb invalidation logic * chore: remove unused deps * resolving todos * a lot of additional bugfixes * 1.88 clippy * wasm fixes * wasm clippy * wallet clippy * wait for epoch end when setting up new network * split ReplyController into Sender and Receiver for easier reasoning * additional reply surbs improvements includes, but is not limited to: unconditionally reseting sender tag on restart, limiting number of surb re-requests, resetting stale surbs on load * fixed calculation of number of removed surbs * add additional calculated field to key rotation info * DBG: 'request_reply_surbs_for_queue_clearing' temp logs * fixes for silly mistakes * conditionally reduce log severity
26 lines
885 B
Rust
26 lines
885 B
Rust
use sqlx::{Connection, SqliteConnection};
|
|
use std::env;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
|
let database_path = format!("{out_dir}/nym-api-example.sqlite");
|
|
|
|
let mut conn = SqliteConnection::connect(&format!("sqlite://{database_path}?mode=rwc"))
|
|
.await
|
|
.expect("Failed to create SQLx database connection");
|
|
|
|
sqlx::migrate!("./migrations")
|
|
.run(&mut conn)
|
|
.await
|
|
.expect("Failed to perform SQLx migrations");
|
|
|
|
#[cfg(target_family = "unix")]
|
|
println!("cargo:rustc-env=DATABASE_URL=sqlite://{}", &database_path);
|
|
|
|
#[cfg(target_family = "windows")]
|
|
// for some strange reason we need to add a leading `/` to the windows path even though it's
|
|
// not a valid windows path... but hey, it works...
|
|
println!("cargo:rustc-env=DATABASE_URL=sqlite:///{}", &database_path);
|
|
}
|