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

Add edgedb adapter

Open brielov opened this issue 3 years ago • 4 comments

Description 📓

Edgedb is an awesome graph database. It reached 1.0 not so long ago and it has a similar developer experience as prisma, with a type-safe query builder. It would be awesome to include an adapter for it. Here's a link if you're not familiar with it.

How to reproduce ☕️

export default function EdgedbAdapter(client, options = {}) {
  return {
    async createUser(user) {
      return client.querySingle(`insert User {
        name := <str>$name
        email := <str>$email
      }`, user)
    },
    // ...rest of the methods
  }
}

Contributing 🙌🏽

Yes, I am willing to help implement this feature in a PR

brielov avatar Jun 19 '22 13:06 brielov

Sounds good, feel free to open a PR!

balazsorban44 avatar Jun 20 '22 09:06 balazsorban44

Hey! I've been wanting to migrate a project to use NextAuth + EdgeDB, would be best if this was an official adapter.

Did you get started with this, @brielov? Do you need a hand?

MartinCura avatar Aug 17 '22 02:08 MartinCura

@MartinCura I haven't been able to find the time yet (It's crazy at work right now), but I was thinking on taking a look at it this weekend. If you have the time, I would love the extra hand. I think the easiest way for me is to just copy whatever the prisma implementation is and just translate the queries to edgedb by accepting the raw client. What do you think?

brielov avatar Aug 17 '22 13:08 brielov

@MartinCura I haven't been able to find the time yet (It's crazy at work right now), but I was thinking on taking a look at it this weekend. If you have the time, I would love the extra hand. I think the easiest way for me is to just copy whatever the prisma implementation is and just translate the queries to edgedb by accepting the raw client. What do you think?

Thought i would receive an email notification, so missed this until now. I had started doing a kind of EdgeDB adapter some months ago, i have to review it to see how far along it was. Starting from Prisma's implementation sounds like a good idea!

MartinCura avatar Aug 21 '22 22:08 MartinCura

It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks!

stale[bot] avatar Oct 21 '22 08:10 stale[bot]

To keep things tidy, we are closing this issue for now. If you think your issue is still relevant, leave a comment and we might reopen it. Thanks!

stale[bot] avatar Oct 28 '22 21:10 stale[bot]

@brielov @MartinCura This died on the vine... any interest still? I am pretty motivated to get this working.

There is some work on it here: https://github.com/cory-evans/next-auth-adapter-edgedb

johnschult avatar Oct 31 '22 11:10 johnschult

Hey @johnschult. I started working on it a little while back, but stopped cause the edgedb team replied a tweet of mine asking them to implement it and they said sure, but I guess they didn't have the time yet. Anyways, I'm still interested and I can for sure give you a hand in whatever I can to make this happen.

brielov avatar Oct 31 '22 11:10 brielov

Hi @brielov I'm game for a PR. Maybe we can hit up someone at EdgeDB to see if they have any interest or ability to help as well. We should be able to get this done.

johnschult avatar Oct 31 '22 11:10 johnschult

@MartinCura @brielov I forked and found a really great example of a new adapter (xata #4911) that recently got merged. Along with the work that was done in https://github.com/cory-evans/next-auth-adapter-edgedb it should not be a big deal. Documentation will likely be a chore, and maybe testing... But it's all doable 💯

If anyone wants to be added as a contributor to my fork and future edgedb-adapter please let me know 😄

https://github.com/johnschult/next-auth

johnschult avatar Nov 04 '22 23:11 johnschult