sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

UnsafeLogged added to report missing fields

Open mrabe89 opened this issue 3 years ago • 1 comments

Hi, - We use your great sqlx library in our projects. I added an optional logging functionality to your unsafe skips to report if a destination is missing, but to still continue. I'm not sure if this is the best way to do that, but if not please provide me with feedback and I will work your suggestions in.

mrabe89 avatar Dec 07 '21 12:12 mrabe89

wow, I was just thinking about making this change and now I see others have needed it for years. The existing error is often helpful, but not for a zero-downtime deploy- in that case this error needs to be turned off to avoid further complicating the deployment. This issue has been raised already.

Given the simple logging needs here, I think it makes sense to use the writer instead of an actual Log instance. Using slog is tempting, but not sure if there is a way to make that backwards compatible with older versions of Go.

gregwebs avatar Aug 11 '23 21:08 gregwebs