From 1748e7556cbcd996e65cde743edc09b0cd79d13a Mon Sep 17 00:00:00 2001 From: Pavel Date: Sun, 17 Mar 2024 19:27:04 +0300 Subject: [PATCH] update sqlc gen --- dal/db_query/queries.sql | 4 ++-- dal/sqlcgen/queries.sql.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dal/db_query/queries.sql b/dal/db_query/queries.sql index d1754fd..1a5d9a2 100644 --- a/dal/db_query/queries.sql +++ b/dal/db_query/queries.sql @@ -520,7 +520,7 @@ WITH Funnel AS ( ta.total_answers, CASE WHEN ta.total_answers = 0 THEN NULL - ELSE COUNT(*)::FLOAT / NULLIF(ta.total_answers, 0) + ELSE CAST(COUNT(*)::FLOAT / NULLIF(ta.total_answers, 0) AS INTEGER) END AS percentage FROM answer a @@ -545,7 +545,7 @@ WITH Funnel AS ( a.content AS answer_content, CASE WHEN q.total_answers = 0 THEN NULL - ELSE COUNT(*)::FLOAT / NULLIF(q.total_answers, 0) + ELSE CAST(COUNT(*)::FLOAT / NULLIF(q.total_answers, 0) AS INTEGER) END AS percentage FROM answer a diff --git a/dal/sqlcgen/queries.sql.go b/dal/sqlcgen/queries.sql.go index b93a8f6..eeeb2c5 100644 --- a/dal/sqlcgen/queries.sql.go +++ b/dal/sqlcgen/queries.sql.go @@ -1614,7 +1614,7 @@ WITH Funnel AS ( ta.total_answers, CASE WHEN ta.total_answers = 0 THEN NULL - ELSE COUNT(*)::FLOAT / NULLIF(ta.total_answers, 0) + ELSE CAST(COUNT(*)::FLOAT / NULLIF(ta.total_answers, 0) AS INTEGER) END AS percentage FROM answer a @@ -1639,7 +1639,7 @@ WITH Funnel AS ( a.content AS answer_content, CASE WHEN q.total_answers = 0 THEN NULL - ELSE COUNT(*)::FLOAT / NULLIF(q.total_answers, 0) + ELSE CAST(COUNT(*)::FLOAT / NULLIF(q.total_answers, 0) AS INTEGER) END AS percentage FROM answer a @@ -1693,10 +1693,10 @@ type QuestionsStatisticsRow struct { CountTStartWithTQuestion int64 `db:"count_t_start_with_t_question" json:"count_t_start_with_t_question"` CountTResult int64 `db:"count_t_result" json:"count_t_result"` ResultsTitle string `db:"results_title" json:"results_title"` - ResultsPercentage interface{} `db:"results_percentage" json:"results_percentage"` + ResultsPercentage int32 `db:"results_percentage" json:"results_percentage"` QuestionsTitle string `db:"questions_title" json:"questions_title"` AnswerContent sql.NullString `db:"answer_content" json:"answer_content"` - QuestionsPercentage interface{} `db:"questions_percentage" json:"questions_percentage"` + QuestionsPercentage int32 `db:"questions_percentage" json:"questions_percentage"` } func (q *Queries) QuestionsStatistics(ctx context.Context, arg QuestionsStatisticsParams) ([]QuestionsStatisticsRow, error) {