Simplify post listing queries.
CI / test (pull_request) Successful in 6m17s

Use named sqlc arguments, scope vote aggregation to selected roots, join viewer votes directly, and add the indexes and drift migration required by the resulting access paths.
This commit is contained in:
2026-08-27 00:22:07 -07:00
parent fc8f286c34
commit e918e5bd1d
5 changed files with 215 additions and 55 deletions
+3
View File
@@ -74,6 +74,9 @@ CREATE TABLE IF NOT EXISTS post_votes (
PRIMARY KEY (user_id, post_id)
);
CREATE INDEX IF NOT EXISTS idx_post_votes_post_id
ON post_votes(post_id);
CREATE TABLE IF NOT EXISTS sessions (
token TEXT PRIMARY KEY,
data BYTEA NOT NULL,