From 100bd1f5c9d1788e956660499e4cf96ef121c1c5 Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Sat, 25 Feb 2023 13:32:49 -0600 Subject: Hack in PATCH `/posts` endpoint --- src/queries.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/queries.h') diff --git a/src/queries.h b/src/queries.h index 809d259..6230f41 100644 --- a/src/queries.h +++ b/src/queries.h @@ -36,9 +36,14 @@ const char *q_insert_posts_with_id = \ "($1, $2, $3) " "RETURNING id;"; +const char *q_update_posts = \ +"UPDATE posts " +"SET title = $1, body = $2, updated_at = NOW() " +"WHERE id = $3 " +"RETURNING id;"; + const char *q_delete_posts = \ "DELETE " "FROM posts " "WHERE id = $1 " "RETURNING id;"; - -- cgit v1.2.3