N
Neon2y ago
extended-salmon

Hey! ... here i was creating twitch

Hey! ... here i was creating twitch clone ...while connecting for data base using neon and prisma... on nextjs app... i am facing a issue ... after creating the db and initialising prisma and allthe npx prisma generate runs successfully but when i run npx prisma db push it doesnt proceed further ... as in pic 2 can someone help me?
No description
No description
35 Replies
national-gold
national-gold2y ago
Hey! Do you still run into the same issue if you run npx prisma migrate dev?
adverse-sapphire
adverse-sapphire2y ago
Yeah
xenial-black
xenial-black2y ago
Add a feature in prisma config Driver something In client object as a experimental feature. It is mentioned in docs. Then try again. @Milan
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
something like this
adverse-sapphire
adverse-sapphire2y ago
okayy I will try
xenial-black
xenial-black2y ago
@Milan Did it work??
adverse-sapphire
adverse-sapphire2y ago
Noo. do i have to install any dependencies for the adapters?
xenial-black
xenial-black2y ago
no
national-gold
national-gold2y ago
the driver adapaters are only needed if you're using the serverless driver with prisma
adverse-sapphire
adverse-sapphire2y ago
tbh I cant get whats happening really i was just doing a twitch clone proj with a reference meanwhile i had to use database other than that because planetscale needs creditcard info which i dont have one rn and also dont have much idea about prisma and this database connections i am just trying to resolve it and learn together sorry 🥲
national-gold
national-gold2y ago
Hey! no worries. I'd love to help you get unblocked. What's odd is that you're not getting any errors 🤔 Do you mind sharing an example repo I can use to test?
adverse-sapphire
adverse-sapphire2y ago
not coding it on git just on my vscode editor :))
national-gold
national-gold2y ago
which tutorial were you following?
adverse-sapphire
adverse-sapphire2y ago
twitch clone by codewithantonio he used planetscale but recommended to use this if we can do that
national-gold
national-gold2y ago
Here's the final code btw https://github.com/AntonioErdeljac/next14-twitch-clone I set it up and I was able to make it work with both db push as well as prisma migrate
GitHub
GitHub - AntonioErdeljac/next14-twitch-clone
Contribute to AntonioErdeljac/next14-twitch-clone development by creating an account on GitHub.
national-gold
national-gold2y ago
I changed the datasource block to this
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
and removed the @@fulltext([name]) from the Stream model
adverse-sapphire
adverse-sapphire2y ago
ya i have the same thing in my code rn
national-gold
national-gold2y ago
hmm, that's weird. If you would like, you can DM the connection details and I can test it you can then reset the credentials after
adverse-sapphire
adverse-sapphire2y ago
do you mean the neon website where i created the db ?
national-gold
national-gold2y ago
yea
adverse-sapphire
adverse-sapphire2y ago
Umm actually have logged in with my mail but i can share the screen if you want?
national-gold
national-gold2y ago
what I meant was the database credentials that are in your .env file
adverse-sapphire
adverse-sapphire2y ago
ohh
national-gold
national-gold2y ago
or you can test with psql if you have it installed on your machine
adverse-sapphire
adverse-sapphire2y ago
yaa sure like the urls?
national-gold
national-gold2y ago
yaa sure like the urls?
yea, and then you can change the password by resetting credentials
adverse-sapphire
adverse-sapphire2y ago
ya its ok this one right?
national-gold
national-gold2y ago
yea this is sensitive info so you shouldn't really share them publicly 😅 you can delete your message haha
adverse-sapphire
adverse-sapphire2y ago
oops you copied? or should i dm?
national-gold
national-gold2y ago
yea I copied and it works
adverse-sapphire
adverse-sapphire2y ago
oukay
national-gold
national-gold2y ago
yea so running both commands worked for me so not sure why it hangs in your case
adverse-sapphire
adverse-sapphire2y ago
huff okay tommorow i will try to re run whole project on diff system and acc or somethin
national-gold
national-gold2y ago
yea all of the tables are there and everything
No description
adverse-sapphire
adverse-sapphire2y ago
i see okay i will try to do it will let you know Thankyou for your time and help :1010: :chefskiss:
national-gold
national-gold2y ago
No problem! Happy learning 😄

Did you find this page helpful?