Replies: 3 comments 5 replies
-
Thank you for the suggestion. Does |
Beta Was this translation helpful? Give feedback.
-
I do remember there are builder pattern which enforce the checking at compile time. Here is one of them https://crates.io/crates/typed-builder |
Beta Was this translation helpful? Give feedback.
-
Context for newcomers, related PR: |
Beta Was this translation helpful? Give feedback.
-
Description
When an
IndexCreateStatement
is not build with a name, the result in mysql will look like this:That query will fail, because of the missing name.
Steps to Reproduce
Suggested Solution
Use builder pattern to expect the
name
,table
andcol
properties of theIndexCreateStatement
to be present. See: https://crates.io/crates/derive_builderExpected Behavior
It would be better if the creation of the
IndexCreateStatement
fails directly, best at compile time, so you cannot forget it. Same goes to providing a table and at least one column.Actual Behavior
It fails at runtime when the query should be executed
Reproduces How Often
always
Workarounds
Remember to put everything in the first place
Versions
Beta Was this translation helpful? Give feedback.
All reactions