Basic tag search and range
parent: tbd commit: 112ca96
1 | |
2 | |
3 | |
4 | use Any; |
5 | use Arc; |
6 | |
7 | use Context; |
8 | |
9 | use Instance; |
10 | use |
11 | BranchStaleAfter, CommitBodyType, DefaultBranch, Description, Repository, Visibility, |
12 | ; |
13 | use ; |
14 | use MetadataProvider; |
15 | use ; |
16 | use ; |
17 | use Value; |
18 | use PgPool; |
19 | use Debug; |
20 | use ; |
21 | |
22 | use crate; |
23 | use crate; |
24 | |
25 | use |
26 | instance_authentication_request, instance_create_repository_request, |
27 | instance_registration_request, repository_commit_before, repository_commit_by_id, |
28 | repository_diff, repository_diff_patch, repository_file_from_id, repository_file_from_path, |
29 | repository_get_branch, repository_get_branches, repository_get_statistics, repository_get_tags, |
30 | repository_info, repository_last_commit_of_file, user_get_repositories, |
31 | ; |
32 | |
33 | /// A backend implementation which attempts to resolve data from the instance's database. |
34 | |
35 | |
36 | |
37 | pub(self) our_instance: Instance, |
38 | pub(self) pool: PgPool, |
39 | pub(self) user_backend: , |
40 | pub(self) repository_backend: , |
41 | pub stack: , |
42 | |
43 | |
44 | |
45 | |
46 | instance: Instance, |
47 | user_backend: , |
48 | repository_backend: , |
49 | pool: PgPool, |
50 | stack: , |
51 | |
52 | Self |
53 | our_instance: instance, |
54 | user_backend, |
55 | repository_backend, |
56 | pool, |
57 | stack, |
58 | |
59 | |
60 | |
61 | |
62 | let mut builder = new; |
63 | |
64 | builder.object_metadata_provider; |
65 | |
66 | builder |
67 | . |
68 | . |
69 | .; |
70 | |
71 | // Register value settings, which are settings that directly correspond to |
72 | // value types. |
73 | builder |
74 | . |
75 | . |
76 | . |
77 | . |
78 | . |
79 | . |
80 | .; |
81 | |
82 | // builder.value(repository_latest_commit); |
83 | |
84 | builder |
85 | .operation |
86 | .operation |
87 | .operation |
88 | .operation |
89 | .operation |
90 | .operation |
91 | .operation |
92 | .operation |
93 | .operation |
94 | .operation |
95 | .operation |
96 | .operation |
97 | .operation |
98 | .operation |
99 | .operation |
100 | .operation; |
101 | |
102 | builder |
103 | |
104 | |
105 | |
106 | |
107 | |
108 | f.debug_struct .finish |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | object.|| object. || object. |
116 | |
117 | |
118 | async |
119 | &self, |
120 | object: AnyObject, |
121 | _object_meta: &ObjectMeta, |
122 | setting: AnySetting, |
123 | setting_meta: &SettingMeta, |
124 | |
125 | if let Some = object. |
126 | ! | query
127 | repository.to_string, setting_meta.name, to_string? |
128 | .execute .await?; |
129 | |
130 | Ok |
131 | else if let Some = object. |
132 | ! | query
133 | user.username, setting_meta.name, to_string? |
134 | .execute .await?; |
135 | |
136 | Ok |
137 | else |
138 | unreachable! |
139 | |
140 | |
141 | |
142 | async |
143 | &self, |
144 | object: AnyObject, |
145 | _object_meta: &ObjectMeta, |
146 | setting_meta: &SettingMeta, |
147 | |
148 | if let Some = object. |
149 | let row = query_as! |
150 | RepositorySettingRow, |
151 | "SELECT * FROM repository_settings WHERE repository = $1 AND name = $2", |
152 | repository.to_string, |
153 | setting_meta.name |
154 | |
155 | .fetch_one |
156 | .await?; |
157 | |
158 | let setting = |
159 | context?; | from_str .
160 | |
161 | Ok |
162 | else if let Some = object. |
163 | info!; |
164 | let row = query_as! |
165 | UserSettingRow, |
166 | "SELECT * FROM user_settings WHERE username = $1 AND name = $2", |
167 | user.username, |
168 | setting_meta.name |
169 | |
170 | .fetch_one |
171 | .await?; |
172 | |
173 | let setting = |
174 | context?; | from_str .
175 | |
176 | Ok |
177 | else |
178 | unreachable! |
179 | |
180 | |
181 | |
182 |