HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
porsager
postgres
JavaScript2019–2026
porsager / postgres

postgres

Postgres.js - The Fastest full featured PostgreSQL client

25Distinct people
48Mentions
1Explicit recommenders
8.8KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Postgres.js - The Fastest full featured PostgreSQL client

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

>> What would you recommend I look at in JS land knowing I love django and dislike flask? I just use typescript and nodejs and the database. No framework except the express web…

andrewstuart used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year48 dated mentions

Observed mentions: 2019-12-23 15:37:50 UTC to 2026-03-17 16:34:21 UTC.

0510152019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 11 mentions; 1 submissions, 10 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 17 mentions; 1 submissions, 16 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC404
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC11110
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC17116
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC808
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC303
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

What Hacker News says

48 sources
Oh hello! Very happy to hear from you, and even happier to be wrong about your "AWOL-ness" (since I want to ship postgres.js to prod). :-) My assumption was just from, afaict, the general lack of triage on GitHub issues, i.e. for a few needs 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 a pita, i.e. where a nontrivial/majority of issues are from well-meaning but maybe naive users asking for free support/filing incorrect/distracting issues. I don't have an answer, but just saying that's where my impression came from. Thanks for replying!
In Pipelining in psql (PostgreSQL 18)
I really want to use pipelining for our "em.flush" of sending all INSERTs & UPDATEs to the db as part of a transaction, b/c my initial prototyping showed a 3-6x increase: https://joist-orm.io/blog/initial-pipelining-benchmark/ If you're not in a transaction, afaiu pipelining is not as applicable/useful b/c any SQL statement failing in the pipeline fails all other queries after it, and imo it would suck for separate/unrelated web requests that "share a pipeline" to have one request fail the others -- but for a single txn/single request, these semantics are what you expect anyway. Unfortunately in the TypeScript ecosystem, the node-pg package/driver doesn't support pipelining 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
Read the rest
TypeScript ORM to postgres.js solely for this "send all our INSERTs/UPDATEs/DELETEs in parallel" perf benefit, and have some great stats so far: https://github.com/joist-orm/joist-orm/pull/1373#issuecommen... But it's not "must have" for us atm, so haven't gotten time to rebase/ship/etc...hoping to rebase & land the PR by eoy...
In Pipelining in psql (PostgreSQL 18)
Type Converters lets you change the parameter value that's executed with the underlying provider (postgres driver uses postgres.js [1]) and what value is converted from the provider's resultset to your class property. So it would be up to whether the underlying provider can be configured to support the custom RDBMS type. If you leave a feature request [2] I can let 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
In Litdb – type safe SQL for JavaScript/TS
Because it turns into a parameterized SQL query. This already exists in the Javascript ecosystem: sql`select * from users where id = ${id}` Turns into: { query: 'select * from users where id = $1', values: [id] } So if you tried an injection like this: sql`select * from users ${'where id = 3'}` It turns into an invalid statement since "where id = 3" cannot exist as a parameterized value for the same reason this doesn't work: { query: 'select * from users $1', values: ['where id = 3'] } Where you go from here is to offer a query(statement) function that requires the use of the tag string so that you can't accidentally pass in a normal string-interpolated string. Examples: - slonik: https://github.com/gajus/slonik?tab=readme-ov-file#protectin... - postgres.js: https://github.com/porsager/postgres?tab=readme-ov-file#quer.
Read the rest
In PEP 750: Tag Strings for Writing Domain-Specific Languages
I want to use this as a chance to bring attention to a GitHub issue that I think would help reduce friction for Neon: https://github.com/neondatabase/neon/issues/4989 If the Neon driver were to allow us to easily pass in a localhost connection, the development 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 adoption. We'd prefer to develop and run tests against a regular Postgres localhost database. To the PMs of Neon, put yourself in the shoes of a new developer thinking of giving Neon a try. What changes will I have to make to my code and my development workflow?
In Neon Serverless Postgres is generally available
"A jaw-dropping amount of effort has been spent attempting to bridge the gap between the relational paradigm of SQL and the object-oriented nature of modern programming languages. EdgeDB sidesteps this problem by modeling data in an object-relational way." All the best to the team. I however truly hope this isn't the direction the industry moves toward. I thought we learned our lesson from MongoDB. I still believe data is best modeled in sets, not objects. The solution isn't for databases to become more like object stores but for general purpose programming 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
In Show HN: PRQL in PostgreSQL
andrewstuart·Jan 25, 2024Recommendation phrase
>> What would you recommend I look at in JS land knowing I love django and dislike flask? I just use typescript and nodejs and the database. No framework except the express web server. It's incredibly raw and close to the metal, which I like. Here's a throwaway example of register and login from ChatGPT to illustrate how easy it is. Totally unchecked but it's just to show approximately what's involved - and it's not much at all. import express, { Request, Response } from 'express'; import bcrypt from 'bcrypt'; import db from './db'; const router = express.Router(); router.post('/register', async (req: Request, res: Response) => { const { username, password } = req.body; // Hash the password const saltRounds = 10; const hashedPassword = await bcrypt.hash(password, saltRounds);
Read the rest
// Insert user into the database db.run('INSERT INTO users (username, password) VALUES (?, ?)', [username, hashedPassword], (err) => { if (err) { console.error(err.message); return res.status(500).json({ error: 'Internal Server Error' }); } return res.status(201).json({ message: 'User registered successfully' }); }); }); router.post('/login', async (req: Request, res: Response) => { const { username, password } = req.body; // Check if user exists db.get('SELECT * FROM users WHERE username = ?', [username], async (err, row) => { if (err) { console.error(err.message); return res.status(500).json({ error: 'Internal Server Error' }); } if (!row) { return res.status(401).json({ error: 'Invalid username or password' }); } const isPasswordValid = await bcrypt.compare(password, row.password); if (!isPasswordValid) { return res.status(401).json({ error: 'Invalid username or password' }); } return res.status(200).json({ message: 'Login successful' }); }); }); 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) { const users = await sql` select name, age from users where age > ${ age } ` // users = Result [{ name: "Walter", age: 80 }, { name: 'Murray', age: 68 }, ...] return users } async function insertUser({ name, age }) { const users = await sql` insert into users (name, age) values (${ name }, ${ age }) returning name, age ` // users = Result [{ name: "Murray", age: 68 }] return users }
In Lightweight JavaScript Framework Review (For Django Developers)
I just started a project and chose this stack: - SSR SvelteKit with Hydration (https://github.com/sveltejs/kit) - 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://www.postgresql.org/docs/16/ddl-rowsecurity.html) - svelte-headlessui (https://github.com/rgossiaux/svelte-headlessui) - sveltekit-i18n (https://github.com/sveltekit-i18n/lib) - TailwindCSS (https://tailwindcss.com/) - Superforms (https://superforms.rocks/) - sveltekit-flash-message + svelte-french-toast (https://github.com/ciscoheat/sveltekit-flash-message + https://github.com/kbrgl/svelte-french-toast) Tooling : - asdf (https://asdf-vm.com/) - Docker and Docker Compose - NodeJS - pnpm - Jest for uni
Read the rest
ttest All deployed on a VM at Scaleway (https://www.scaleway.com/en/) with Bash script (https://github.com/stephane-klein/sveltekit-tendaro-webshell...) After 3 months of development on this stack, I'm very satisfied. My application is fast, light and requires very little code. Project skeleton example: https://github.com/stephane-klein/sveltekit-tendaro-webshell...
In Ask HN: If you were to build a web app today what tech stack would you choose?

Showing the 15 most recent of 48 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.