feat(labrinth): user preferences (#7177)

* feat(labrinth): initial preferences structure

* feat(labrinth): use partially to derive partial structs

* feat(labrinth): preference defaults

* fix(labrinth): derive debug

* feat(labrinth): user preferences db setup

* feat(labrinth): user preferences routes

* fix(labrinth): nested partial structs

* fix(labrinth): serialize enums as snake case

* refactor(labrinth-derive): rename to component-derive

* feat(component-derive): nested components

* refactor(component-derive): change suffixes to prefixes

* refactor(component-derive): rename edit to partial

* feat(component-derive): skip serializing empty option

* refactor(labrinth): wrap errors

* feat(component-derive): diff function

* style(labrinth): fmt

* refactor(labrinth): use component derive and only store overrides

* chore: update query cache

* docs(labrinth): add preferences to openapi

* fix(labrinth): lock row for update

* remove: partially

* refactor(component-derive): split impls to separate functions

* feat(component-derive): wrap impls to isolate naming

* refactor(labrinth): split out auth conditions

* feat(labrinth): store auto

* feat(labrinth): store hosting privacy

* style(labrinth): cargo fmt
This commit is contained in:
Sychic
2026-08-17 17:57:57 +00:00
committed by GitHub
parent b3b0b85691
commit 46d07163cd
18 changed files with 680 additions and 173 deletions
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT preferences AS \"preferences: Json<PartialUserPreferences>\"\n FROM user_preferences\n WHERE user_id = $1\n FOR UPDATE\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "preferences: Json<PartialUserPreferences>",
"type_info": "Jsonb"
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false
]
},
"hash": "829fa6bb9dd88f401abc4b5164d69f43909750257d6b4f86cfecc89568b86cb9"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT preferences AS \"preferences: Json<PartialUserPreferences>\"\n FROM user_preferences\n WHERE user_id = $1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "preferences: Json<PartialUserPreferences>",
"type_info": "Jsonb"
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false
]
},
"hash": "9c97cb31c02777c10c329d17504267e8328df9846d35c4df149752098a750caa"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO user_preferences (user_id, preferences)\n VALUES ($1, $2)\n ON CONFLICT (user_id) DO UPDATE\n SET preferences = EXCLUDED.preferences\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8",
"Jsonb"
]
},
"nullable": []
},
"hash": "b301f61d9e57ba351cc12f47066823cd02c215c4b219859724928ebdb99e493f"
}