2026-05-15backend

PostgreSQL data layer introduced

  • Change: Raw postgres package added as the sole database client. lib/db.ts exports a singleton sql tagged-template client. app/lib/actions.ts was 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 postgres package.
    • Con: No schema migration tooling at this point; table creation is guarded by a lazy ensurePostsTable() call on every cold start.