How to use sqlx::migrate! in a nested child? #4087
Replies: 1 comment
|
For example, with this layout: the invocation in static MIGRATOR: sqlx::migrate::Migrator =
sqlx::migrate!("../../migrations");The two The macro expects a string literal, so interpolating One related detail: on stable Rust, add a fn main() {
println!("cargo:rerun-if-changed=../../migrations");
}This path behavior is documented in |
Uh oh!
There was an error while loading. Please reload this page.
my workspace at root level: [migrations, crates]
the file where I am using migrate! is in crates/x/y/z/xyz.rs, in a similar scenario, I got away with
CARGO_WORKSPACE_DIRbut what can be done in sqlx case?doing
../../../../migrationsgives me error canonicalizing migration directory ..... no such file or directory.All reactions