Skip to content

Commit 8aa1bd7

Browse files
committed
store: Streamline how we get ErrorDetail a little
1 parent 1a31994 commit 8aa1bd7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

store/postgres/src/detail.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ pub struct DeploymentDetail {
6868
#[diesel(table_name = subgraph_error)]
6969
// We map all fields to make loading `Detail` with diesel easier, but we
7070
// don't need all the fields
71-
#[allow(dead_code)]
7271
pub(crate) struct ErrorDetail {
73-
vid: i64,
7472
pub id: String,
7573
subgraph_id: String,
7674
message: String,
@@ -93,7 +91,7 @@ impl ErrorDetail {
9391
d::table
9492
.filter(d::deployment.eq(deployment_id.as_str()))
9593
.inner_join(e::table.on(e::id.nullable().eq(d::fatal_error)))
96-
.select(e::all_columns)
94+
.select(ErrorDetail::as_select())
9795
.get_result(conn)
9896
.optional()
9997
.map_err(StoreError::from)
@@ -105,7 +103,6 @@ impl TryFrom<ErrorDetail> for SubgraphError {
105103

106104
fn try_from(value: ErrorDetail) -> Result<Self, Self::Error> {
107105
let ErrorDetail {
108-
vid: _,
109106
id: _,
110107
subgraph_id,
111108
message,
@@ -327,13 +324,13 @@ pub(crate) fn deployment_statuses(
327324
if sites.is_empty() {
328325
d::table
329326
.inner_join(join)
330-
.select((d::id, e::all_columns))
327+
.select((d::id, ErrorDetail::as_select()))
331328
.load::<(DeploymentId, ErrorDetail)>(conn)?
332329
} else {
333330
d::table
334331
.inner_join(join)
335332
.filter(d::id.eq_any(sites.iter().map(|site| site.id)))
336-
.select((d::id, e::all_columns))
333+
.select((d::id, ErrorDetail::as_select()))
337334
.load::<(DeploymentId, ErrorDetail)>(conn)?
338335
}
339336
.into_iter()

0 commit comments

Comments
 (0)