Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf643daf

Browse files
committed
fix coalesce and cleanup with array remove
1 parent77e8382 commitf643daf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎coderd/database/queries.sql.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/insights.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ WITH ts AS (
6565
SELECT
6666
COALESCE((SELECT idsFROM template_ids),'{}')::uuid[]AS template_ids,
6767
-- Return IDs so we can combine this with GetTemplateAppInsights.
68-
array_agg(DISTINCT user_id)::uuid[]AS active_user_ids,
68+
COALESCE(array_agg(DISTINCT user_id),'{}')::uuid[]AS active_user_ids,
6969
COALESCE(SUM(usage_vscode_seconds),0)::bigintAS usage_vscode_seconds,
7070
COALESCE(SUM(usage_jetbrains_seconds),0)::bigintAS usage_jetbrains_seconds,
7171
COALESCE(SUM(usage_reconnecting_pty_seconds),0)::bigintAS usage_reconnecting_pty_seconds,
@@ -194,7 +194,7 @@ WITH ts AS (
194194
SELECT
195195
from_AS start_time,
196196
to_AS end_time,
197-
COALESCE(array_agg(DISTINCT template_id) FILTER (WHERE template_idIS NOT NULL),'{}')::uuid[]AS template_ids,
197+
array_remove(array_agg(DISTINCT template_id),NULL)::uuid[]AS template_ids,
198198
COUNT(DISTINCT user_id)AS active_users
199199
FROM unflattened_usage_by_day
200200
GROUP BY from_, to_;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp