This commit is contained in:
Feike Steenbergen 2025-05-03 17:05:22 +00:00 committed by GitHub
commit 8890beb6f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,9 +42,7 @@ func queryNamespaceMapping(server *Server, namespace string, mapping MetricMapNa
var err error
if !found {
// I've no idea how to avoid this properly at the moment, but this is
// an admin tool so you're not injecting SQL right?
rows, err = server.db.Query(fmt.Sprintf("SELECT * FROM %s;", namespace)) // nolint: gas
rows, err = server.db.Query(fmt.Sprintf("SELECT * FROM %s;", pq.QuoteIdentifier(namespace))) // nolint: gas
} else {
rows, err = server.db.Query(query)
}