Sub-issue of #9, depends on #9a (shared helpers) ``` pub fn insert_book(conn, title, author, status) -> Result(Book, AppError) ``` - `INSERT INTO books (title, author, status) VALUES ($1, $2, $3) RETURNING id, title, author, status` - Convert `BookStatus` to string via `status_to_string` for the `$3` parameter - Pattern match `returned.rows` — expect exactly `[book]`, otherwise `DatabaseError`
Sub-issue of #9, depends on #9a (shared helpers)
INSERT INTO books (title, author, status) VALUES ($1, $2, $3) RETURNING id, title, author, statusBookStatusto string viastatus_to_stringfor the$3parameterreturned.rows— expect exactly[book], otherwiseDatabaseError