adelsz/pgtyped
pgTyped - Typesafe SQL in TypeScript observed · 2026-08-28
Health v2 · maintenance only
74/100
- Activity 99
- Release rhythm 28
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 33
- age_days: 2536
- days_rel: 537
- days_push: 7
- n_releases_24m: 2
Adoption not part of the score
3276 stars · 116 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
PgTyped is a TypeScript library that generates static types for raw SQL queries against a running PostgreSQL database. It parses queries from SQL or TS files and produces typed query functions without requiring schema definitions or acting as an ORM.
Use cases
- generate TypeScript types for raw SQL queries
- use raw SQL with type safety in a Node.js app
- avoid writing an ORM schema mapping for Postgres
- prevent SQL injection when writing parameterized queries
- auto-generate query result and parameter interfaces from a live Postgres database
- write SQL in .sql files and get typed query functions
When to choose
- you prefer writing raw SQL over query builders or ORMs
- you want compile-time type checking of query parameters and results
- your team uses PostgreSQL with TypeScript and wants minimal runtime overhead
- you want the live database schema to be the source of truth for types
When to avoid
- you need an ORM with relations, migrations, and schema management
- you use a database other than PostgreSQL
- you don't want a running database connection during development for type generation
- you need runtime query building or dynamic SQL composition
Facets
library · maturity active
database database-driver type-system developer-tools databases developer-tools web-development backend cross-platform sql postgres type-safety query-generator code-generation raw-sql esm nodejs typescript
3 sources
- readme: https://github.com/adelsz/pgtyped · fetched 2026-08-28 · 13b736c7793e
- homepage: https://pgtyped.dev · fetched 2026-08-29 · 062f3f53da91
- site_page: https://pgtyped.dev/docs · fetched 2026-08-29 · f50ec97f6489
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| adelsz/pgtyped | main | 74 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem