generated from Patagia/template-nix
Compare commits
1 commit
65dd4f889c
...
af00d4a3b0
Author | SHA1 | Date | |
---|---|---|---|
af00d4a3b0 |
4 changed files with 9 additions and 1 deletions
controller
|
@ -16,7 +16,7 @@ serde.workspace = true
|
|||
slog-async.workspace = true
|
||||
slog.workspace = true
|
||||
sqlx = { version = "0.8.3", default-features = false, features = [
|
||||
"macros", "postgres", "runtime-tokio", "tls-rustls", "time", "uuid"
|
||||
"macros", "migrate", "postgres", "runtime-tokio", "tls-rustls", "time", "uuid"
|
||||
] }
|
||||
tokio.workspace = true
|
||||
trace-request = { path = "../trace-request" }
|
||||
|
|
5
controller/build.rs
Normal file
5
controller/build.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
// generated by `sqlx migrate build-script`
|
||||
fn main() {
|
||||
// trigger recompilation when a new migration is added
|
||||
println!("cargo:rerun-if-changed=migrations");
|
||||
}
|
|
@ -74,6 +74,8 @@ async fn main() -> Result<()> {
|
|||
|
||||
let pg = PgPool::connect(&database_url).await?;
|
||||
|
||||
sqlx::migrate!().run(&pg).await?;
|
||||
|
||||
let ctx = ControllerContext::new(pg);
|
||||
let api = api::api()?;
|
||||
ServerBuilder::new(api, Arc::new(ctx), logger)
|
||||
|
|
|
@ -3,3 +3,4 @@ pub mod context;
|
|||
|
||||
mod user;
|
||||
mod version;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue