Skip to content

Commit

Permalink
implement API version of get_row()
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcmicu committed Sep 19, 2024
1 parent a73e21a commit 4b89c58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/valve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2326,8 +2326,10 @@ impl Valve {
}

/// Given a table name and a row number, return a [ValveRow] representing that row.
pub async fn get_row(&self, table: &str, row: &u32) -> Result<ValveRow> {
todo!()
pub async fn get_row(&self, table: &str, row_number: &u32) -> Result<ValveRow> {
let mut tx = self.pool.begin().await?;
let row = get_row_from_db(&self.config, &self.pool, &mut tx, table, row_number).await?;
ValveRow::from_rich_json(Some(*row_number), &row)
}

/// Given a table name and a row number, search for and return the row number of the row that
Expand Down

0 comments on commit 4b89c58

Please sign in to comment.