Sqlx macros with optional newtypes

⚓ rust    📅 2025-05-14    👤 surdeus    👁️ 2      

surdeus

It seems the very strict compile time type checking of sqlx macros is making it virtually impossible to have a newtype based on a as an optional TEXT field in Postgres. With the 'assistance' of multiple LLM's I keep running into issues where in the end the advice is to move away from the macro's due to them not being able to figure it out. Are there others here that have the same experience, or maybe even the magic sauce to make it work? I can paste the problematic code upon request, but this is more of a what-is-your-experience-with-this type of question.

Of course I can move away from the marco's but I kanda like the compile time checking bit..

Thanks!

1 post - 1 participant

Read full topic

🏷️ rust_feed