Chris Tsang

Results 417 comments of Chris Tsang

I think it is more a limitation of Rust's orphan rule, so not likely to be changed soon. But actually if you own the other struct in your crate, you...

Oh Nice I wanted to say this a long time ago. But it's also good to think about whether we can avoid panicking on a case by case basis.

Hey thank you for your effort. I have a slightly different idea to the implementation, might need @billy1624 's help indeed.

I am thinking of adding a method to `RuntimeErr`: ```rust impl RuntimeErr { pub fn sql_err(&self) -> SqlError; } #[non_exhaustive] enum SqlError { UniqueConstraintViolation, ForeignKeyConstraintViolation, } ``` So we always...

The reasoning is: 1. to preserve the original SQLx error 2. to construct a hierarchical namespace. With `#[non_exhaustive]`, we can add more variants to `SqlError` later. 3. the error is...

Actually, I am not against downcasting, so we can try downcasting to MySqlErr, and that we will be able to know which database it is originated from.

Actually I strongly appreciate another pair of eyes to look at this

Thanks for the suggestion @ikrivosheev