diff options
Diffstat (limited to 'makima/src/db/repository.rs')
| -rw-r--r-- | makima/src/db/repository.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs index aa1203a..c7b0a1f 100644 --- a/makima/src/db/repository.rs +++ b/makima/src/db/repository.rs @@ -5363,6 +5363,19 @@ pub async fn get_last_completed_step_task_id( // Directive Step CRUD // ============================================================================= +/// Get a single directive step by ID. +pub async fn get_directive_step( + pool: &PgPool, + step_id: Uuid, +) -> Result<Option<DirectiveStep>, sqlx::Error> { + sqlx::query_as::<_, DirectiveStep>( + r#"SELECT * FROM directive_steps WHERE id = $1"#, + ) + .bind(step_id) + .fetch_optional(pool) + .await +} + /// List all steps for a directive, ordered by order_index. pub async fn list_directive_steps( pool: &PgPool, |
