Determines the type of an actor by its ID. # Errors - [`StoreError`] if a database error occurs [`StoreError`]: PrincipalError::StoreError
(
&self,
actor_id: impl Into<Uuid>,
)
| 163 | /// |
| 164 | /// [`StoreError`]: PrincipalError::StoreError |
| 165 | pub async fn is_actor( |
| 166 | &self, |
| 167 | actor_id: impl Into<Uuid>, |
| 168 | ) -> Result<bool, Report<PrincipalError>> { |
| 169 | self.as_client() |
| 170 | .query_one( |
| 171 | "SELECT EXISTS(SELECT 1 FROM actor WHERE id = $1)", |
| 172 | &[&actor_id.into()], |
| 173 | ) |
| 174 | .instrument(tracing::info_span!( |
| 175 | "SELECT", |
| 176 | otel.kind = "client", |
| 177 | db.system = "postgresql", |
| 178 | peer.service = "Postgres", |
| 179 | )) |
| 180 | .await |
| 181 | .map(|row| row.get(0)) |
| 182 | .change_context(PrincipalError::StoreError) |
| 183 | } |
| 184 | |
| 185 | /// Gets an actor by its ID. |
| 186 | /// |
no test coverage detected