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:
@@ -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)";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user