next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

feat(adapter): add `postgres.js` adapter

Open CodyBontecou opened this issue 1 year ago • 4 comments

☕️ Reasoning

Adding a postgres.js database adapter.

🧢 Checklist

  • [x] Documentation
  • [x] Tests
  • [x] Ready to be merged

🎫 Affected issues

📌 Resources

CodyBontecou avatar Apr 12 '24 23:04 CodyBontecou

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Apr 12, 2024 11:04pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Apr 12, 2024 11:04pm

vercel[bot] avatar Apr 12 '24 23:04 vercel[bot]

What's the difference between this as the pg-based adapter (@auth/pg-adapter)?

ndom91 avatar Apr 13 '24 17:04 ndom91

This uses postgres.js instead of node-postgres.

CodyBontecou avatar Apr 13 '24 21:04 CodyBontecou

This uses postgres.js instead of node-postgres.

Right, but what's the advantage of one over the other?

ndom91 avatar Apr 14 '24 01:04 ndom91

There's another PR adding an adapter which uses postgres.js (see: https://github.com/nextauthjs/next-auth/pull/11200), we'd love it if you two could sync and just put up 1 high(er) quality PR :pray:

ndom91 avatar Jun 20 '24 13:06 ndom91

My PR was a pretty quick hack with plenty of TS-related errors. It's probably best to go with their PR.

CodyBontecou avatar Jun 20 '24 22:06 CodyBontecou