Hacker GitHub

← All repos

porsager/postgres

View on GitHub ↗ ★ 8,742 JavaScript

Postgres.js - The Fastest full featured PostgreSQL client

48 mentions on Hacker News by 25 people: 3 stories, 45 comments · first 2019-12-23 · latest 2026-03-17

Mentions per year 48 mentions · busiest year 2023 (17)
20082026
  1. …better and has zero deps but mostly depends on a single guy. [1] https://npmgraph.js.org/?q=pg [2] https://github.com/porsager/postgres
    comment by pier25 · 2026-03-17 · in Node.js needs a virtual file system
  2. Is there a way to make this work with https://github.com/porsager/postgres ? It's very close to raw SQL but with safe substitutions. I use it with Zod, but it would be great to have the types derived automatically.
  3. …we have like tracing/APM, and then also admittedly esoteric topics like this stack trace fixing: https://github.com/porsager/postgres/issues/963#issuecomment... Fwiw I definitely sympathize with issue triage being time-consuming/sometimes…
    comment by stephen · 2025-10-12 · in Pipelining in psql (PostgreSQL 18)
  4. …yet, instead this "didn't quite hit mainstream adoption and now the author is AWOL" driver does: https://github.com/porsager/postgres I've got a branch to convert our TypeScript ORM to postgres.js solely for this "send all our…
    comment by stephen · 2025-10-12 · in Pipelining in psql (PostgreSQL 18)
  5. …its own PG driver [2] and Jarred has written they will keep investing into more built-in APIs. [1] https://github.com/porsager/postgres [2] https://bun.com/docs/api/sql
  6. …you know when it's implemented or it's not possible with postgres.js when I get around to it. [1] https://github.com/porsager/postgres [2] https://github.com/litdb/litdb/discussions/categories/ideas
  7. …changing in the node ecosystem with projects like https://hono.dev/ (koa/express successor) and https://github.com/porsager/postgres having zero deps.
    comment by hombre_fatal · 2024-11-19 · in The tragedy of running an old Node project
  8. …Examples: - slonik: https://github.com/gajus/slonik?tab=readme-ov-file#protectin... - postgres.js: https://github.com/porsager/postgres?tab=readme-ov-file#quer...
  9. …connection for listening per process. Listen/notify is also super useful with triggers. [1] https://github.com/porsager/postgres#listen--notify
  10. …and test experience would be easier. Perhaps Neon could swap to something like this internally: https://github.com/porsager/postgres . Having run a local dev environment connected to Neon and tests connected to Neon got in our way of…
  11. …languages to be more amenable to seamless access of set-oriented data. More stuff like this: https://github.com/porsager/postgres https://github.com/launchbadge/sqlx
    comment by ttfkam · 2024-02-19 · in Show HN: PRQL in PostgreSQL
  12. …but also provides a backdoor, so sql`select ${"hello"}, ${sql`world`}` becomes select $1, world [1] https://github.com/porsager/postgres
    comment by surprisetalk · 2024-02-09 · in Hono v4.0
  13. …}); }); export { router as routes }; For database I use the postgres.js library which is super nice https://github.com/porsager/postgres examples from postgres.js front page: import sql from './db.js' async function getUsersOver(age) {…
  14. …) - PostgreSQL database server - Postgres.js - PostgreSQL client for Node.js ( https://github.com/porsager/postgres ) - Migration powered by graphile-migrate ( https://github.com/graphile/migrate ) - PostgreSQL Row-Level Security ( https
  15. Thanks Pier! Your comment saved me some frustration here :-D https://github.com/porsager/postgres/discussions/627#discuss...
  16. …himself: > it seems Postgres.js is actually faster than, not only pg, but of any driver out-there - https://github.com/porsager/postgres/discussions/627 - https://porsager.github.io/imdbench/sql.html
  17. …named prepared statements can be disabled by setting "prepare" to false in the connection settings: https://github.com/porsager/postgres#connection-details
    comment by fauigerzigerk · 2023-10-14 · in PostgresJs: PostgreSQL client for Node.js and Deno
  18. …where the parse/describe/bind/execute/sync data is created is, in my opinion, pretty bad code: https://github.com/porsager/postgres/blob/bf082a5c0ffe214924...
  19. ▲ 308
    PostgresJs: PostgreSQL client for Node.js and Deno
    story by jerawaj749 · 2023-10-14 · 143 comments
  20. …himself: > it seems Postgres.js is actually faster than, not only pg, but of any driver out-there - https://github.com/porsager/postgres/discussions/627 - https://porsager.github.io/imdbench/sql.html
  21. …that try to do things in a sane way without wasting your time. Postgres.js [1] is one of them. [1] https://github.com/porsager/postgres
  22. there's also https://kysely.dev/ but personally i handwrite my queries with https://github.com/porsager/postgres for flexibility and performance most orms use node-pg lib which has shit performance.
  23. …lot to be desired. Some tools do make good efforts though such as nested fragments in this driver. https://github.com/porsager/postgres#building-queries
    comment by ttfkam · 2023-09-17 · in Relational is more than SQL
  24. …multitude of "ORMs are bad" articles / discussions. For instance - I would love to be able to use https://github.com/porsager/postgres with sqlite.
  25. Demonstrate how easily and accidentally one can make an SQL injection with these: https://github.com/porsager/postgres https://github.com/gajus/slonik
    comment by ttfkam · 2023-06-29 · in Is ORM still an anti-pattern?
  26. Agreed! First time I used the postgres Node library [0], I was sold! [0] https://github.com/porsager/postgres
    comment by ttfkam · 2023-06-29 · in Is ORM still an anti-pattern?
  27. I recently discovered https://github.com/porsager/postgres I think this is how an ORM for SQL databases should be. Unfortunately I don't use Node on the backend (Rails, Django, Phoenix) but I wish there would be ORMs like that for those…
    comment by pmontra · 2023-06-28 · in Is ORM still an anti-pattern?
  28. In NodeJS land this library is pretty close to this: https://github.com/porsager/postgres
  29. It's JS with the wonderful Postgres.js package! [1] https://github.com/porsager/postgres Here's an example where it really shines: const users = [ { name: 'Murray', age: 68 }, { name: 'Walter', age: 80 }, ]; await sql`insert into users ${…
    comment by surprisetalk · 2023-06-19 · in IKEA-Oriented Development
  30. They've looked at Postgres.js ( https://github.com/porsager/postgres ) before — wouldn't mind if they enabled those other cases in the same way. Also, node-postgres is ripe for sql injections because you just concatenate strings yourself…
    comment by porsager · 2023-05-01 · in Storage on Vercel
  31. …was a breeze. I also think it's a great starting point for anyone looking to learn JavaScript. [0] https://github.com/porsager/postgres
    comment by keb_ · 2022-09-29 · in Deno 1.26 Release Notes
  32. …works on Deno. For testing, Deno includes a built-in test runner and assertions via the std[1]. [0] https://github.com/porsager/postgres [1] https://deno.land/manual/testing
  33. …client is implemented in JavaScript. Queries can be written using JavaScript template literals. [0] https://github.com/porsager/postgres [1] https://news.ycombinator.com/item?id=30794332
    comment by tauchunfall · 2022-05-11 · in Deno.js in production
  34. …understand, but RDS Proxy would just hang until this was changed to UTF8 (uppercase with no dash). https://github.com/porsager/postgres/issues/288
  35. Tbh I think this is quite risky to mess it up. Using a simple regex to convert… https://github.com/porsager/postgres/blob/master/transpile.c...
  36. …dependencies. Even transpilation from ES modules into commonjs is done by the author himself: https://github.com/porsager/postgres/blob/master/transpile.c... I’m not sure if I’d made the same choice, but it’s fun the see it can work out…
  37. I hit a small type issue migrating from v2 to v3 that's not listed in the migration: https://github.com/porsager/postgres/issues/283
  38. …chance of SQL injection[2]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://github.com/porsager/postgres#await-sql---result
  39. …syntax down to the bare essentials, and what you've done with Imba is really impressive! [1] https://github.com/porsager/postgres#raw
  40. …handling for large scale use, cancellation of requests, Typescript suport, async cursors. [1] https://github.com/porsager/postgres-benchmarks#results [2] https://github.com/porsager/postgres#realtime-subscribe [3]…
  41. ▲ 257
    Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
    story by porsager · 2022-03-24 · 83 comments
  42. …to SQL injection attacks unless you actually put some extra effort into doing something foolish. https://github.com/porsager/postgres#readme
    comment by ttfkam · 2021-06-19 · in DenoDB
  43. …and that helpers for different things all are sql(something) while doing very different things. https://github.com/porsager/postgres/blob/master/lib/index.j... I also tend to compose queries out of smaller static parts dynamically, and…
  44. …the goto node driver tolerable to work with. In the process I made it 4-5 times faster as well. https://github.com/porsager/postgres
  45. Anyone know how this compares to porsager's "postgres" lib? https://github.com/porsager/postgres
  46. the template syntax reminds me of an other postgres libary https://github.com/porsager/postgres
  47. Yes you should be able to model that using `.begin()` and `.savepoint()` within. https://github.com/porsager/postgres#savepoint-sqlsavepointn... Is that what you're looking for?
  48. ▲ 14
    Show HN: Postgres.js – Fast PostgreSQL Client for Node.js
    story by porsager · 2019-12-23 · 12 comments