2026-05-15backend
PostgreSQL data layer introduced
- Change: Raw
postgrespackage added as the sole database client.lib/db.tsexports a singletonsqltagged-template client.app/lib/actions.tswas created to hold all read queries (getPost,ensurePostsTable). - Why: Needed server-side data for the home page post gallery.
- Affected Modules:
lib/db.ts,app/lib/actions.ts,app/page.tsx,package.json - Trade-offs:
- Pro: Zero-overhead raw SQL with full type inference from the
postgrespackage. - Con: No schema migration tooling at this point; table creation is guarded by a lazy
ensurePostsTable()call on every cold start.
- Pro: Zero-overhead raw SQL with full type inference from the