Closed dinhani closed 2 years ago
Thank you for your suggestion. I agree with that. PR is welcomed.
Hey @dinhani, welcome! Sorry for the delay! Yeah, it's definitely doable and making it much easier to debug.
For anyone who is reading this, I'll mark this issue as open for contributions :)
@billy1624
hello, Could you please assign me with this issue?
@kyoto7250 done)
@ikrivosheev
Thank you.
I will try it.
Thanks! @kyoto7250 let me know if you need any help along the way :) Feel free to open a draft PR
Motivation
A common error I make is forgetting to map a nullable column using
Option
, so I receive the error messageerror occurred while decoding: Null
.I would like the have the column name in the error message so I can easily identify what column was mapped wrongly.
Proposed Solutions
It seems the column name is available in all places the Null error is generated, so it would be nice if the column name is passed to it as parameter, so it can be included in error message.
Additional Information
Example of code where
col
parameter exists and could be used to identify the column that failed with the Null message: https://github.com/SeaQL/sea-orm/blob/0c96e133250b7c8ab43a6a99931b82c95f59acc1/src/executor/query.rs#L346-L354