Skip to content

Commit b2d5e9e

Browse files
fixed sdk scrape query
1 parent caf0c26 commit b2d5e9e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

modules/module-postgres-storage/src/storage/PostgresReportStorageFactory.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,18 @@ export class PostgresReportStorageFactory implements storage.ReportStorageFactor
335335
sdk
336336
)
337337
SELECT
338-
COALESCE(u.count, 0) AS users,
339-
JSON_AGG(ROW_TO_JSON(s)) AS sdks
340-
FROM
341-
unique_users u
342-
JOIN sdk_versions_array s ON TRUE;
338+
(
339+
SELECT
340+
COALESCE(count, 0)
341+
FROM
342+
unique_users
343+
) AS users,
344+
(
345+
SELECT
346+
JSON_AGG(ROW_TO_JSON(s))
347+
FROM
348+
sdk_versions_array s
349+
) AS sdks;
343350
`
344351
.decoded(SdkReporting)
345352
.first();

0 commit comments

Comments
 (0)