aboutsummaryrefslogtreecommitdiff
path: root/src/queries.h
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2023-02-25 13:32:49 -0600
committerMichael McVady <femtonaut@gmail.com>2023-02-25 13:32:49 -0600
commit100bd1f5c9d1788e956660499e4cf96ef121c1c5 (patch)
treed7b361058a487329b40745b1b23346b117b9e4e7 /src/queries.h
parent174907730bd2175bddc896cb6484918e2e5064f5 (diff)
Hack in PATCH `/posts` endpoint
Diffstat (limited to 'src/queries.h')
-rw-r--r--src/queries.h7
1 files changed, 6 insertions, 1 deletions
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;";
-