Have got post creation working.

This commit is contained in:
Leon Mika 2025-01-27 14:23:54 +11:00
parent 63b19a249a
commit 8e0ffb6c24
20 changed files with 479 additions and 11 deletions

14
sql/queries/posts.sql Normal file
View file

@ -0,0 +1,14 @@
-- name: ListPosts :many
SELECT * FROM post WHERE site_id = $1 ORDER BY post_date DESC LIMIT 25;
-- name: InsertPost :one
INSERT INTO post (
site_id,
title,
body,
state,
props,
post_date,
created_at
) VALUES ($1, $2, $3, $4, $5, $6, $7)
RETURNING id;