sqlx
sqlx copied to clipboard
UnsafeLogged added to report missing fields
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.
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.