test(db): zero-label authority round-trip; doc the labels-json constant

Also fix pre-existing clippy::explicit_auto_deref in all db test files
(&mut *tx → &mut tx across authority.rs and vocab.rs).
This commit is contained in:
2026-06-02 09:01:06 +02:00
parent 6e45baa8d4
commit 7782bd764a
3 changed files with 33 additions and 7 deletions
+1
View File
@@ -3,6 +3,7 @@
use domain::{Authority, AuthorityId, AuthorityKind, AuthorityRef, LocalizedLabel, NewAuthority};
use sqlx::Row;
/// Labels aggregated per row as JSON, to read an authority and its labels in one query.
const LABELS_JSON: &str = "COALESCE(json_agg(json_build_object('lang', al.lang, 'label', al.label) \
ORDER BY al.lang) FILTER (WHERE al.authority_id IS NOT NULL), '[]'::json)";