$ show liam-hq/liam
Liam is a full-stack web application and CLI toolchain for database schema design and visualization. It parses schemas from multiple formats (PostgreSQL, Prisma, Drizzle, tbls, schema.rb), renders interactive Entity-Relationship Diagrams (ERDs) using React Flow, and provides an AI-assisted workflow powered by LangGraph agents. Users can create design sessions, chat with a team of AI agents (PM, DB, QA) that analyze requirements, generate schema changes, create migration SQL, and validate via pgTAP tests. The frontend is built with Next.js and Supabase for authentication, real-time updates, and data persistence. A CLI tool allows local ERD generation from schema files. The monorepo includes numerous internal packages for schema parsing, UI components, error handling (neverthrow), and in-browser PostgreSQL execution (PGlite).
The LLM identified 3 files worth highlighting for reuse:
Combines valibot schema parsing with neverthrow Result types to provide a safe parsing function that returns Ok with parsed value or Err with structured error details. This pattern is reusable in any TypeScript project requiring validated input with explicit error handling, avoiding try/catch. It demonstrates a clean separation of validation logic and error propagation.
A standalone utility for parsing pgTAP (PostgreSQL Test Anything Protocol) test output into structured success/failure results. It handles diagnostic lines, test counts, and nested results. This parser can be extracted and reused in any project that needs to programmatically interpret pgTAP results, such as CI pipelines or automated schema validation tools.
Manages ephemeral PGlite (in-browser PostgreSQL) instances, handling extension loading (pgcrypto, pg_stat_statements) via a switch statement to work around bundler restrictions, and transaction lifecycle (begin/commit/rollback). It isolates each query to a fresh connection and maps query results. This component is reusable for any client-side or serverless application needing a disposable PostgreSQL environment, such as educational tools, testing frameworks, or schema validation sandboxes.