mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 12:05:53 +00:00
feat: use postcard for redis serde (#6956)
* redo error handling in xredis * give proper types to metadata fields * add round-trip tests * inline loader enum metadata fields * postcard roundtrips * prepare * bump redis key version * serde-binhum * clippy * fix * fix frontend checking existence of component fields rather than non-null-ness * prepare
This commit is contained in:
@@ -394,11 +394,13 @@ async fn build_search_documents(
|
||||
|
||||
let loader_field_enum_values: Vec<QueryLoaderFieldEnumValue> =
|
||||
sqlx::query!(
|
||||
"
|
||||
SELECT DISTINCT id, enum_id, value, ordering, created, metadata
|
||||
r#"
|
||||
SELECT DISTINCT id, enum_id, value, ordering, created,
|
||||
metadata->>'type' AS "ty?",
|
||||
(metadata->>'major')::boolean AS "major?"
|
||||
FROM loader_field_enum_values lfev
|
||||
ORDER BY enum_id, ordering, created DESC
|
||||
"
|
||||
"#
|
||||
)
|
||||
.fetch(pool)
|
||||
.map_ok(|m| QueryLoaderFieldEnumValue {
|
||||
@@ -407,7 +409,8 @@ async fn build_search_documents(
|
||||
value: m.value,
|
||||
ordering: m.ordering,
|
||||
created: m.created,
|
||||
metadata: m.metadata,
|
||||
ty: m.ty,
|
||||
major: m.major,
|
||||
})
|
||||
.try_collect()
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user