- Notifications
You must be signed in to change notification settings - Fork1k
Commitf941e78
authored
chore: add db query to retrieve workspaces & their agents (#14792)
Second PR for#14716.Adds a query that, given a user ID, returns all the workspaces they own, that can also be `ActionRead` by the requesting user.```type GetWorkspacesAndAgentsByOwnerIDRow struct {WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"`WorkspaceName string `db:"workspace_name" json:"workspace_name"`JobStatus ProvisionerJobStatus `db:"job_status" json:"job_status"`Transition WorkspaceTransition `db:"transition" json:"transition"`Agents []AgentIDNamePair `db:"agents" json:"agents"`}``` `JobStatus` and `Transition` are set using the latest build/job of the workspace. Deleted workspaces are not included.1 parent31506e6 commitf941e78
File tree
15 files changed
+551
-38
lines changed- coderd/database
- dbauthz
- dbmem
- dbmetrics
- dbmock
- migrations
- queries
15 files changed
+551
-38
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2789 | 2789 |
| |
2790 | 2790 |
| |
2791 | 2791 |
| |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
2792 | 2800 |
| |
2793 | 2801 |
| |
2794 | 2802 |
| |
| |||
4242 | 4250 |
| |
4243 | 4251 |
| |
4244 | 4252 |
| |
| 4253 | + | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
4245 | 4257 |
| |
4246 | 4258 |
| |
4247 | 4259 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1470 | 1470 |
| |
1471 | 1471 |
| |
1472 | 1472 |
| |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1473 | 1491 |
| |
1474 | 1492 |
| |
1475 | 1493 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6839 | 6839 |
| |
6840 | 6840 |
| |
6841 | 6841 |
| |
| 6842 | + | |
| 6843 | + | |
| 6844 | + | |
| 6845 | + | |
| 6846 | + | |
6842 | 6847 |
| |
6843 | 6848 |
| |
6844 | 6849 |
| |
| |||
11224 | 11229 |
| |
11225 | 11230 |
| |
11226 | 11231 |
| |
| 11232 | + | |
| 11233 | + | |
| 11234 | + | |
| 11235 | + | |
| 11236 | + | |
| 11237 | + | |
| 11238 | + | |
| 11239 | + | |
| 11240 | + | |
| 11241 | + | |
| 11242 | + | |
| 11243 | + | |
| 11244 | + | |
| 11245 | + | |
| 11246 | + | |
| 11247 | + | |
| 11248 | + | |
| 11249 | + | |
| 11250 | + | |
| 11251 | + | |
| 11252 | + | |
| 11253 | + | |
| 11254 | + | |
| 11255 | + | |
| 11256 | + | |
| 11257 | + | |
| 11258 | + | |
| 11259 | + | |
| 11260 | + | |
| 11261 | + | |
| 11262 | + | |
| 11263 | + | |
| 11264 | + | |
| 11265 | + | |
| 11266 | + | |
| 11267 | + | |
| 11268 | + | |
| 11269 | + | |
| 11270 | + | |
| 11271 | + | |
| 11272 | + | |
| 11273 | + | |
| 11274 | + | |
| 11275 | + | |
| 11276 | + | |
| 11277 | + | |
| 11278 | + | |
| 11279 | + | |
| 11280 | + | |
| 11281 | + | |
| 11282 | + | |
| 11283 | + | |
| 11284 | + | |
| 11285 | + | |
| 11286 | + | |
| 11287 | + | |
| 11288 | + | |
| 11289 | + | |
| 11290 | + | |
| 11291 | + | |
| 11292 | + | |
11227 | 11293 |
| |
11228 | 11294 |
| |
11229 | 11295 |
| |
|
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + |
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + |
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
221 | 221 |
| |
222 | 222 |
| |
223 | 223 |
| |
| 224 | + | |
224 | 225 |
| |
225 | 226 |
| |
226 | 227 |
| |
| |||
320 | 321 |
| |
321 | 322 |
| |
322 | 323 |
| |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
323 | 367 |
| |
324 | 368 |
| |
325 | 369 |
| |
|
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
0 commit comments
Comments
(0)