mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-19 10:12:47 +08:00
* wrap instead of embedding sqlx.DB Expose helper methods that route to sqlx.DB instead of requiring callers to sometimes access .DB directly for themselves. (We could rename this to `.db` to emphasize that it's internal, but some callers legitimately do need it, and it's all the same package so the diff just gets noisier.) This change continues to improve our ability to avoid queries without configured timeouts, but does not yet directly address the original report. Relates-to: https://mattermost.atlassian.net/browse/MM-68332 * fix contradictory comment on sqlxTxWrapper.Query * rename DB→db and Tx→tx; add DB() accessor Make the sqlx.DB and sqlx.Tx fields unexported within the package to signal they are internal, while exposing a DB() method for the cases where callers need the sqlx handle directly. * pipe passthrough errors through checkErr for offline detection Ensure network failures in Query, ExecContext, and QueryContext methods mark the replica offline, consistent with all other wrapper methods. * fix config test: DB is now a method, not a field