diff options
author | Michael McVady <femtonaut@gmail.com> | 2024-01-11 23:43:25 -0600 |
---|---|---|
committer | Michael McVady <femtonaut@gmail.com> | 2024-01-11 23:43:25 -0600 |
commit | f810fe19b8152a32254133680e3d6f506e2277e6 (patch) | |
tree | badafac7e1e876b74c7cd5e4a4c98684e9ee3625 /src/queries.h | |
parent | f2aec9a94cee58d0e23f1a636f7eccd34f63a2b5 (diff) |
Just keep hacking
Diffstat (limited to 'src/queries.h')
-rw-r--r-- | src/queries.h | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/src/queries.h b/src/queries.h index c0bd1dc..3956129 100644 --- a/src/queries.h +++ b/src/queries.h @@ -1,40 +1,35 @@ const char *q_select_entry = -"SELECT id, title, created_at::DATE, body " +"SELECT id, title, created_at::DATE, updated_at::DATE, body " "FROM entries " "WHERE id = $1;"; const char *q_select_entries = -"SELECT id, title, created_at::DATE, body " +"SELECT id, title, created_at::DATE, updated_at::DATE, body " "FROM entries " "ORDER BY updated_at DESC;"; -const char *q_select_index = -"SELECT id, title, created_at::DATE, updated_at::DATE " -"FROM entries " -"ORDER BY updated_at DESC;"; +// const char *q_insert_entry = +// "INSERT INTO entries " +// "(title, body) " +// "VALUES " +// "($1, $2) " +// "RETURNING id;"; -const char *q_insert_entry = -"INSERT INTO entries " -"(title, body) " -"VALUES " -"($1, $2) " -"RETURNING id;"; +// const char *q_insert_entry_with_id = +// "INSERT INTO entries " +// "(id, title, body) " +// "VALUES " +// "($1, $2, $3) " +// "RETURNING id;"; -const char *q_insert_entry_with_id = -"INSERT INTO entries " -"(id, title, body) " -"VALUES " -"($1, $2, $3) " -"RETURNING id;"; +// const char *q_update_entry = +// "UPDATE entries " +// "SET title = $1, body = $2, updated_at = NOW() " +// "WHERE id = $3 " +// "RETURNING id;"; -const char *q_update_entry = -"UPDATE entries " -"SET title = $1, body = $2, updated_at = NOW() " -"WHERE id = $3 " -"RETURNING id;"; - -const char *q_delete_entry = -"DELETE " -"FROM entries " -"WHERE id = $1 " -"RETURNING id;"; +// const char *q_delete_entry = +// "DELETE " +// "FROM entries " +// "WHERE id = $1 " +// "RETURNING id;"; |