-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add prisma #38
Add prisma #38
Conversation
@G3root is attempting to deploy a commit to the Developerdao Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome @G3root thank you! I'm going to check this soon in my machine locally. I'll get back at this!
This sounds promising https://cloud.prisma.io/ . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finally able to review it thoroughly, had a lot of things prioritized so was not really able to give a full review. And with that I have some requested changes too.
Thank you once again, it does look awesome!
Let's prefer rename the Prisma models to be singular than them being plural:
model Users
->model User
model Gigs
->model Gig
But are we able to override the table names? (e.g. If we have model User
singular, then when it gets migrated its table name would be users
). Or would Prisma automatically transform singular models into plural lower-cased table names? (The very similar thing on how Laravel does it or other frameworks that uses a similar approach)
Also when you start changing those status
attributes to use an Enum, then the default values should be DRAFT for the most of it.
The cuid()
is awesome and it looks like Firestore document IDs. Previously I think they used uuid
s but looks like cuid
is more of an improved version. So that's nice to learn about it from this PR :) @G3root
deletedAt DateTime? //optional field | ||
users UserKeyword[] | ||
jobs JobKeyword[] | ||
keywords GigKeyword[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be gigs GigKeyword[]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh by the way just noticed, my mistake. This regard this comment @G3root
It looks awesome, I also want to give it a try and explore more about it. Would be interesting to know what it offers 👀 |
thanks for the thorough review @carlomigueldy, i'll ship those changes today |
What does it do?
adds prisma as an ORM
Any helpful background information?
this is a Draft PR to adapt prisma as an ORM.
for more info check #25
task list
Does it close any issues?
This closes #25
To Test locally
DATABASE_URL
environment variableDATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
yarn generate
to generate typesyarn studio
to manipulate data in a GUI