adelsz/pgtyped
View on GitHub ↗ ★ 3,286 TypeScript
pgTyped - Typesafe SQL in TypeScript
25 mentions on Hacker News by 18 people: 2 stories, 23 comments · first 2019-09-29 · latest 2025-10-05
20082026
-
https://github.com/adelsz/pgtyped
comment by denysonique · 2025-10-05 · in Parrot – type-safe SQL in Gleam, supports SQlite, PostgreSQL and MySQL -
…in the past and it does a good job at taking raw SQL and generating the return types from runtime: https://github.com/adelsz/pgtyped
comment by jadbox · 2024-12-06 · in Litdb – type safe SQL for JavaScript/TS -
…more practical takes that codegen types from your database and generate types for your queries, eg: https://github.com/adelsz/pgtyped To me the second approach seems much more pragmatic because you don’t need to run a SQL parser in your…
comment by jitl · 2024-03-24 · in Type-Safe Printf() in TypeScript -
…liking pgTyped. Transactions are supported as pgTyped is just a thin wrapper around node-postgres: https://github.com/adelsz/pgtyped/discussions/448
comment by alde · 2023-10-15 · in PostgresJs: PostgreSQL client for Node.js and Deno -
I wonder why pgtyped [1] was skipped [1] https://github.com/adelsz/pgtyped
comment by mrl5 · 2023-08-04 · in Neon: Comparing type-safe SQL libraries for TypeScript -
How does this compare with pgTyped[1]? [1] https://github.com/adelsz/pgtyped
comment by httgp · 2023-06-21 · in Show HN: Kysely, a type-safe SQL query builder for TypeScript -
There's pgtyped, which I believe does almost the same as sqlc https://github.com/adelsz/pgtyped
comment by lacasito25 · 2023-04-29 · in Deno 1.33: Deno 2 is coming -
For Postgres there is https://github.com/adelsz/pgtyped , sounds pretty much like what you describe?
comment by csnweb · 2023-01-24 · in Kysely: TypeScript SQL Query Builder -
You might also want to consider pgTyped ( https://github.com/adelsz/pgtyped ). It's supposed to make SQL and TS work together. I haven't gotten around to using it yet but I hear good things.
comment by robertn702 · 2023-01-24 · in Kysely: TypeScript SQL Query Builder -
…with TypeScript(/WASM-target for the future?), with a type-safe SQL codegen library such as: https://github.com/adelsz/pgtyped Update update: Or reluctantly with Python instead, with a similar library such as PugSQL.
comment by rajnathani · 2022-08-01 · in Programming languages endorsed for server-side use at Meta -
PgTyped is another high quality alternative: https://github.com/adelsz/pgtyped .
comment by ntonozzi · 2022-06-08 · in Deepkit – High-Performance TypeScript Framework -
We're using a very similar lib for typescript: https://github.com/adelsz/pgtyped Would love to hear if any others of comparable or better quality exist for js/ts
comment by forrest2 · 2021-09-08 · in How We Went All In on sqlc/pgx for Postgres and Go -
…more of the fact that we don't know how to do it properly than it not offering a good solution. [1] https://github.com/adelsz/pgtyped [2] https://github.com/ovotech/laminar
comment by seer · 2021-07-15 · in SQLBolt – Interactive lessons and exercises to learn SQL -
If I'm understanding you, you might like pgtyped: https://github.com/adelsz/pgtyped (If you mean infer solely off of queries, I don't think that's possible unless you jam a bunch of type casts into the field selection part of the query.)
comment by cldellow · 2021-06-20 · in Postgres to TypeScript Interfaces and Enums -
…and it is great for writing arbitrary SQL queries and getting full typescript support. [1] https://github.com/adelsz/pgtyped
comment by nickreese · 2021-04-21 · in Prisma – ORM for Node.js and TypeScript -
…data access for your project, but for just replacing ORMs I think I really prefer the approach of https://github.com/adelsz/pgtyped where you have raw sql files / template literals and it will create types for parameters and results.
comment by seer · 2021-04-21 · in Prisma – ORM for Node.js and TypeScript -
…no knowledge of the pg schema, so it cannot help with this. You may want to look at something like https://github.com/adelsz/pgtyped . The downside is that dynamic queries are more challenging. We have been looking at moving over to…
comment by hermanradtke · 2021-03-11 · in Slonik: A PostgreSQL client with strict types, detailed logging, and assertions -
…Now TS and sql doesn’t really have a robust lib for that I think, last time I checked it was only https://github.com/adelsz/pgtyped But haven’t looked at how far it has progressed.
comment by seer · 2020-10-21 · in What ORMs Have Taught Me: Just Learn SQL (2014) -
I've been following https://github.com/adelsz/pgtyped for awhile. It should give you TS types from sql files (and even sql template literals) directly. Though I haven't used it in prod. Might be worth a look.
comment by seer · 2020-07-13 · in Rust Is Surprisingly Good as a Server Language -
▲ 269
Show HN: PgTyped – Typesafe SQL in TypeScript and Postgresstory by alde · 2020-05-25 · 88 comments
-
…implement SQL-in-TS type inference in PgTyped[1] with autocomplete and validation on the way. [1]: https://github.com/adelsz/pgtyped
comment by alde · 2020-03-31 · in Prisma 2.0 Beta: Type-safe Database Access -
…Still very alpha, but promising. I'm working on integrating PgTyped into Huncwot [2] [1]: https://github.com/adelsz/pgtyped [2]: https://github.com/huncwotjs/huncwot
comment by zaiste · 2020-03-31 · in Prisma 2.0 Beta: Type-safe Database Access -
…generator that makes it possible to use inline SQL in TypeScript code with guaranteed type-safety. https://github.com/adelsz/pgtyped
comment by alde · 2020-03-21 · in Ask HN: What projects are you working on now? -
▲ 9
Show HN: PgTyped – Typesafe SQL – TypeScript types generator for raw SQL queriesstory by alde · 2019-09-29 · 3 comments