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

feat(adapters): add Xata adapter

Open TejasQ opened this issue 3 years ago • 6 comments

This PR adds a next-auth adapter for Xata, a new database. Xata is currently private beta, but we're already using it internally with next-auth and we'd love to contribute this to the source for our early access users and for our own internal dogfooding.

TejasQ avatar Jul 12 '22 16:07 TejasQ

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

1 Ignored Deployment
Name Status Preview Updated
next-auth ⬜️ Ignored (Inspect) Oct 27, 2022 at 10:06AM (UTC)

vercel[bot] avatar Jul 12 '22 16:07 vercel[bot]

Hey y'all, Xata is currently closed beta, but we'd love to have this added here because we'd like to use it internally, and we can only do that if it's published to the npm registry. 😬

Can we do this?

TejasQ avatar Jul 12 '22 18:07 TejasQ

So here's a Loom about how this works:

https://www.loom.com/share/6ab4792d5f45468ea355c9b8ae904388

Some notes that came out of this:

  1. I will update the docs to follow this flow more closely,
  2. About automated integration tests, we could maybe create a sample database to use for this. Do you think that's a good idea? Or do you have a better one in mind?

TejasQ avatar Jul 13 '22 09:07 TejasQ

Thanks, I'll have a look. Yeah, I think creating a sample database for testing would be nice. We can use environment variables from the GitHub Actions, similarly to the Upstash adapter:

https://github.com/nextauthjs/next-auth/blob/70ffa6592fb490c224bde41db2257fdb63af34b7/packages/adapter-upstash-redis/tests/index.test.ts#L6-L14

Compared to locally runnable (i.e. Docker or similar) databases, the only downside is that these environment variables won't be shared with fork PRs, but once we ironed out the details, we might not expect many changes to the adapter code, and I can run tests on my branches or locally anyway, so it should be good. :+1: Anyone else could create their own test database for local testing.

balazsorban44 avatar Jul 13 '22 12:07 balazsorban44

Awesome! I'll get cracking on the tests. 😬

TejasQ avatar Jul 13 '22 13:07 TejasQ

Just remembered, could you add the adapter to these lists:

For auto-labeling issues: https://github.com/nextauthjs/next-auth/blob/main/.github/issue-labeler.yml https://github.com/nextauthjs/next-auth/blame/main/.github/ISSUE_TEMPLATE/3_bug_adapter.yml#L23-L34

For auto-labeling PRs https://github.com/nextauthjs/next-auth/blob/main/.github/pr-labeler.yml

balazsorban44 avatar Jul 19 '22 21:07 balazsorban44

Just remembered, could you add the adapter to these lists:

For auto-labeling issues: https://github.com/nextauthjs/next-auth/blob/main/.github/issue-labeler.yml https://github.com/nextauthjs/next-auth/blame/main/.github/ISSUE_TEMPLATE/3_bug_adapter.yml#L23-L34

For auto-labeling PRs https://github.com/nextauthjs/next-auth/blob/main/.github/pr-labeler.yml

Done in https://github.com/nextauthjs/next-auth/pull/4911/commits/352a40ed45dbc89efd7e51809418c6e9b5b40a30!

TejasQ avatar Oct 13 '22 09:10 TejasQ

Okay! I've added tests and everything else required. This LGTM to me so far. Did I miss anything? 🤩

TejasQ avatar Oct 13 '22 09:10 TejasQ

I’m noticing a couple of checks are still pending. Is this something I can fix? 🧐

TejasQ avatar Oct 14 '22 13:10 TejasQ

I would love to see this happen, hoping to use it on stream Thursday 🙏

raae avatar Oct 18 '22 14:10 raae

@ThangHuuVu, @balazsorban44, done! 🙌

TejasQ avatar Oct 27 '22 10:10 TejasQ

Thanks Mr. Advantageous @TejasQ 🙌😆 I will do a release shortly for the new package and some other changes

ThangHuuVu avatar Oct 27 '22 14:10 ThangHuuVu

Do we know when the release will be? Trying to plan out some streams.

raae avatar Nov 02 '22 07:11 raae