-
I'm developing an application that uses diesel and, as many young applications, it has a schema that keeps changing:
for source in [include_str!("migrations/migration_1/up.sql"), ..., include_str!("migrations/migration_n/up.sql")] {
for statement in source.split(';') { // Can't execute multiple statements
if source.is_empty() { // Can't execute empty lines
continue;
}
let sql = sql_query(source);
sql.execute(&connection)?;
}
} While this kinda works, this has a number of drawbacks:
Is there any better workflow? Note that I'm not a db admin, so the only way I can affect the database is through my app. |
Beta Was this translation helpful? Give feedback.
Answered by
weiznich
Apr 13, 2021
Replies: 1 comment 1 reply
-
You likely want to use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Yoric
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You likely want to use
embed_migration!
instead