(
&self,
object_type: &str,
id: &str,
)
| 282 | } |
| 283 | |
| 284 | pub async fn get( |
| 285 | &self, |
| 286 | object_type: &str, |
| 287 | id: &str, |
| 288 | ) -> PersistenceResult<Option<ObjectRecord>> { |
| 289 | let row = sqlx::query( |
| 290 | r" |
| 291 | SELECT object_type, id, name, payload, created_at_ms, updated_at_ms, labels, resource_version |
| 292 | FROM objects |
| 293 | WHERE object_type = $1 AND id = $2 |
| 294 | ", |
| 295 | ) |
| 296 | .bind(object_type) |
| 297 | .bind(id) |
| 298 | .fetch_optional(&self.pool) |
| 299 | .await |
| 300 | .map_err(|e| map_db_error(&e))?; |
| 301 | |
| 302 | Ok(row.map(row_to_object_record)) |
| 303 | } |
| 304 | |
| 305 | pub async fn get_by_name( |
| 306 | &self, |
no test coverage detected