Skip to content

Verify schema at runtime #4399

Answered by weiznich
axos88 asked this question in Q&A
Dec 18, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

There is currently no built-in way to perform such a schema verification automatically. I'm also not aware of any third party crate that offers this functionality.

The currently best way to ensure that your schema is always what you expect is to use the embed_migration!() macro and then apply the migrations on application startup.

That written we are interested in adding such a verification functionality to diesel at some point so if you are interested in working on this feature we can certainly discuss technical details.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by axos88
Comment options

You must be logged in to vote
1 reply
@weiznich
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants