Skip to content

Missing Query Tag (ARCH5057)

Key go.orm.missing-query-tag · Severity info · Category orm

Not tagging a query with a comment makes it hard to attribute slow-query logs to their source. Tag the query with a SQL comment.

db.Where("status = ?", "active").Find(&users)
db.Clauses(hints.CommentBefore("select", "user-list-handler")).
Where("status = ?", "active").Find(&users)

Add a comment tag (e.g. hints.CommentBefore) to terminal queries for log/APM correlation.