aboutsummaryrefslogtreecommitdiff
path: root/src/queries.h
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2023-10-26 23:29:11 -0500
committerMichael McVady <femtonaut@gmail.com>2023-10-26 23:34:42 -0500
commita997ec6727b467fd72510a56bfe7a67eb04dbcf9 (patch)
treebbd1babe15bb83db10d831061a4dd5110638589c /src/queries.h
parente24dfc3412648c8b07a32a59774ed21f5058f7e0 (diff)
Remove JSON API
Diffstat (limited to 'src/queries.h')
-rw-r--r--src/queries.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/queries.h b/src/queries.h
index 2334874..ffc9c7b 100644
--- a/src/queries.h
+++ b/src/queries.h
@@ -1,26 +1,13 @@
-const char *q_select_html_post =
+const char *q_select_post =
"SELECT id, title, created_at::DATE, body "
"FROM posts "
"WHERE id = $1;";
-const char *q_select_html_posts =
+const char *q_select_posts =
"SELECT id, title, created_at::DATE, body "
"FROM posts "
"ORDER BY updated_at DESC;";
-const char *q_select_json_post =
-"SELECT JSON_AGG(ROW_TO_JSON(row)) FROM ("
- "SELECT id, title, body, created_at, updated_at "
- "FROM posts "
- "WHERE id = $1"
-") row;";
-
-const char *q_select_json_posts =
-"SELECT JSON_AGG(ROW_TO_JSON(row)) FROM ("
- "SELECT id, title, body, created_at, updated_at "
- "FROM posts "
- "ORDER BY updated_at DESC"
-") row;";
const char *q_insert_posts =
"INSERT INTO posts "