Switch to ARRAY_AGG for database aggregations to improve peformance + fix gallery images not showing up (#242)

This commit is contained in:
Geometrically authored and GitHub committed 2021-08-31 15:29:51 -07:00
1 parent f37e267a5e
commit efb82847cb
6 files changed
+923 -923

No files matched your search

+2 -2
View File
@@ -303,7 +303,7 @@ impl Loader {
let result = sqlx::query!(
"
SELECT l.id id, l.loader loader, l.icon icon,
STRING_AGG(DISTINCT pt.name, ',') project_types
ARRAY_AGG(DISTINCT pt.name) project_types
FROM loaders l
LEFT OUTER JOIN loaders_project_types lpt ON joining_loader_id = l.id
LEFT OUTER JOIN project_types pt ON lpt.joining_project_type_id = pt.id
@@ -319,7 +319,7 @@ impl Loader {
supported_project_types: x
.project_types
.unwrap_or_default()
.split(',')
.iter()
.map(|x| x.to_string())
.collect(),
}))