sqlx
sqlx copied to clipboard
Fix expansion of `sqlx(flatten)`
Given a generic type like A<B> before sqlx would produce
A<B>::from_row(row) which is invalid syntax.
Now it produces <A<B> as ::sqlx::FromRow<'a, R>>.
This also fixes a bug for non-generic types where an inherent method
might have been called instead of the ::sqlx::FromRow::from_row method
because UFCS wasn't used.
I would also recommend not using a single letter generic parameter in macros because it will easily conflict with the users of the macro. (In this case I had a conflict with the chosen parameter name R). I can also update that if you think that's worthwhile to change.
I can also update that if you think that's worthwhile to change.
That sounds fine, yeah.