hezarfen_backend
Clone
https://git.tahinli.com/archive/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | //! Deterministic wire keys shared by the per-sitting exam tables and the |
| 2 | //! image-slot tables. |
| 3 | // |
| 4 | // With natural composite primary keys these are no longer storage ids — a |
| 5 | // row is keyed by its component columns. They are the **HTTP edge** form only: |
| 6 | // when a sitting key or a slot key crosses a path or body, it travels as one |
| 7 | // underscore-joined string, and these helpers are its single spelling. |
| 8 | |
| 9 | /// The wire key for a `(scope, user, seq)` triple, where `scope` is whatever |
| 10 | /// the row hangs off — an exam for attempts and results, a question for |
| 11 | /// answers and drawings. The first sitting keeps the historical |
| 12 | /// `{scope}_{user}` shape — rows written before per-attempt history existed |
| 13 | /// stay addressable, unchanged, forever — so only later sittings carry their |
| 14 | /// number. That bare-`seq == 1` case is migration law, not a style choice: |
| 15 | /// change it and every pre-history row becomes unreachable. UUID strings |
| 16 | /// contain only `-` and hex, so `_` is an unambiguous joiner. |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | /// The wire key for one image slot on `owner` — `{owner}_q` for the thing's |
| 26 | /// own illustration, `{owner}_{choice id}` for one option's picture. A UUID is |
| 27 | /// never `"q"` and never contains `_`, so the two shapes can never collide — |
| 28 | /// the rule behind every image table's slot keys, spelled once. |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 |