pgtyped brings type safety to SQL queries in TypeScript by parsing SQL files and generating typed query functions. It analyzes SQL against your PostgreSQL schema and outputs TypeScript code that ensures inputs and results are correctly typed. This allows teams to use raw SQL while retaining the safety and developer experience of TypeScript.