Re-expose Operation State in generics.
This is the worst code I have ever written. I hate the way this changes everything. ugh.
parent: tbd commit: 90db3e2
1 | use Arc; |
2 | |
3 | use Error; |
4 | |
5 | use Repository; |
6 | |
7 | use User; |
8 | |
9 | use GiteratedStack; |
10 | use Value; |
11 | use PgPool; |
12 | use OnceCell; |
13 | |
14 | use MetadataBackend; |
15 | |
16 | |
17 | pub pg_pool: PgPool, |
18 | pub stack: , |
19 | |
20 | |
21 | |
22 | |
23 | async |
24 | let row = query_as! |
25 | UserSettingRow, |
26 | "SELECT * FROM user_settings WHERE username = $1 AND name = $2", |
27 | user.username, |
28 | name |
29 | |
30 | .fetch_one |
31 | .await?; |
32 | |
33 | let setting = from_str?; |
34 | |
35 | Ok |
36 | |
37 | async |
38 | ! | query
39 | user.username, name, to_string? |
40 | .execute .await?; |
41 | |
42 | Ok |
43 | |
44 | |
45 | async |
46 | &mut self, |
47 | repository: &Repository, |
48 | name: &str, |
49 | |
50 | let row = query_as! |
51 | RepositorySettingRow, |
52 | "SELECT * FROM repository_settings WHERE repository = $1 AND name = $2", |
53 | repository.to_string, |
54 | name |
55 | |
56 | .fetch_one |
57 | .await?; |
58 | |
59 | let setting = from_str?; |
60 | |
61 | Ok |
62 | |
63 | async |
64 | &mut self, |
65 | repository: &Repository, |
66 | name: &str, |
67 | value: Value, |
68 | |
69 | ! | query
70 | repository.to_string, name, to_string? |
71 | .execute .await?; |
72 | |
73 | Ok |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | pub username: String, |
81 | pub name: String, |
82 | pub value: String, |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | pub repository: String, |
89 | pub name: String, |
90 | pub value: String, |
91 | |
92 |