From 2bcf4534331327e596761ddf7d18626b99c5194a Mon Sep 17 00:00:00 2001 From: ashish sonam Date: Mon, 14 Aug 2023 11:13:48 +0530 Subject: [PATCH] refactored sql query --- pkg/chartRepo/repository/ChartRepoRepository.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/chartRepo/repository/ChartRepoRepository.go b/pkg/chartRepo/repository/ChartRepoRepository.go index a0b8ae3e469..b7d42bd6e7e 100644 --- a/pkg/chartRepo/repository/ChartRepoRepository.go +++ b/pkg/chartRepo/repository/ChartRepoRepository.go @@ -132,9 +132,8 @@ func (impl ChartRepoRepositoryImpl) FindDeploymentCountByChartRepoId(chartId int " inner join installed_apps ia on iav.installed_app_id = ia.id" + " inner join app_store_application_version asav on iav.app_store_application_version_id = asav.id" + " inner join app_store aps on asav.app_store_id = aps.id" + - " where ia.active=true and iav.active=true and aps.chart_repo_id = " + strconv.Itoa(chartId) + - " ;" - _, err := impl.dbConnection.Query(&activeDeploymentCount, query) + " where ia.active=(?) and iav.active=(?) and aps.chart_repo_id = (?);" + _, err := impl.dbConnection.Query(&activeDeploymentCount, query, true, true, strconv.Itoa(chartId)) return activeDeploymentCount, err }