How to extract Sonar Scans and code coverage report from Sonar Backend Database like Postgres

  • I am using SonarQube 8.6 Version
  • I want to extract Sonar Scans and code coverage report from Sonar Backend Database like PostgreSQL Using Select query.
    Could you please someone help me on this ?

Hi @mr.engineer,

The SonarQube database schema is subject to change between versions, so instead of direct database queries, you should use the Web API to extract data. You can find complete documentation for it by following the Web API link in the footer of any SonarQube page. Some useful queries to look at are api/issues/search for issues and api/measures/component for code metrics.

Regards,

Cameron.

Thanks for your time @Cameron
I am not familiar with api’s so i am finding some alternative solutions that’s why I am asking is it possible to fetch report from database?

Hi @mr.engineer,

Looks like we can close this topic after my response on the API and my colleague Tobias’s answer over in this thread.

Regards,

Cameron.