14 lines
283 B
MySQL
14 lines
283 B
MySQL
|
|
-- name: SelectPostsOfSite :many
|
||
|
|
SELECT * FROM posts WHERE site_id = ? ORDER BY created_at DESC LIMIT 10;
|
||
|
|
|
||
|
|
-- name: InsertPost :one
|
||
|
|
INSERT INTO posts (
|
||
|
|
site_id,
|
||
|
|
guid,
|
||
|
|
title,
|
||
|
|
body,
|
||
|
|
slug,
|
||
|
|
created_at,
|
||
|
|
published_at
|
||
|
|
) VALUES (?, ?, ?, ?, ?, ?, ?)
|
||
|
|
RETURNING id;
|