Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to replace Knex with Prisma #276

Open
isBatak opened this issue May 16, 2021 · 5 comments
Open

Ability to replace Knex with Prisma #276

isBatak opened this issue May 16, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@isBatak
Copy link
Contributor

isBatak commented May 16, 2021

This is just an idea, but it would be cool to support Prisma and implement PrismaProcessor.
https://www.prisma.io/

@joelalejandro joelalejandro added the enhancement New feature or request label Jun 21, 2021
@joelalejandro
Copy link
Member

Looks very interesting @isBatak, it seems that it supports pretty much everything covered by Knex. However, instead of replacing, I'd like to keep support for Knex, since it's already there.

On the long run, if we add more support for packages like Knex or Prisma, we'd need to create a DatabaseProcessor with the generic features and then both KnexProcessor and PrismaProcessor can implement from there. However, this feels a bit cumbersome at present, given that we need to explore more APIs to come up with an adequate abstraction.

Have you used Prisma before? I'm not entirely familiar with it.

@isBatak
Copy link
Contributor Author

isBatak commented Jun 21, 2021

Yeah, wrong title... it should be more like "Ability to replace Knex with Prisma".

I like the DatabaseProcessor idea, it could be an abstract class or interface. Kinda a side-thought, can TS compiler do a Dead Code Elimination (three-shaking) of abstract class methods 🤔 . I'm primarily a Front-end developer so I always think about bundle size.

To be honest I don't have a real experience with Prisma but it seems like a great solution for serverless architecture.
I'm experimenting with a combination of Kurier, Next.js, Datx here https://github.com/isBatak/next-js-json-api-starter.
Next.js/Vercel is built with serverless in mind on top of AWS Lambda@Edge, and to use any database we need to have some kind of connection pool. I read that Knex has some solution but it's unreliable and should be handled on the DB side (like PgBouncer https://www.pgbouncer.org/).
So it seems to me that Prisma is a much simpler solution and it works OTB with Next.js.

I agree that this is a long shot for now...

@isBatak isBatak changed the title Replace Knex with Prisma Ability to replace Knex with Prisma Jun 21, 2021
@joelalejandro
Copy link
Member

Interesting. You might want to take a look at #282 then, since we're starting to include features to make Kurier compatible with serverless environments as well. The fact that Prisma works out-of-the-box with Next.js also makes me want to explore more how an integration would look like.

@isBatak
Copy link
Contributor Author

isBatak commented Jun 22, 2021

I saw #282 and I'm really excited and can't wait to test it... is it included in 1.2.0-alpha1 version?

@joelalejandro
Copy link
Member

Yes, you can try it out in 1.2.0-alpha1, beware of the unforseen dragons bugs though :P

@joelalejandro joelalejandro moved this to ⌛ Waiting in Kurier Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Waiting
Development

No branches or pull requests

2 participants