Skip to content

Commit

Permalink
exporter: add field alias for count(*) func
Browse files Browse the repository at this point in the history
If not adding an alias for count(*), the Count field of
projectCount will always be 0, because it can't be parsed from the correct field name.

Signed-off-by: bin liu <liubin0329@gmail.com>
  • Loading branch information
liubin committed Aug 28, 2023
1 parent 560e6cd commit aefea57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pkg/exporter/project_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
const ProjectCollectorName = "ProjectCollector"

var (
totalProjectSQL = `SELECT project_metadata.value AS public, COUNT(project_metadata.value)
totalProjectSQL = `SELECT project_metadata.value AS public, COUNT(project_metadata.value) as count
FROM project INNER JOIN project_metadata ON project.project_id=project_metadata.project_id
WHERE project.deleted=FALSE AND project_metadata.name='public'
GROUP BY project_metadata.value;`
Expand Down

0 comments on commit aefea57

Please # to comment.