N
Neon2y ago
like-gold

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
rare-sapphire
rare-sapphire2y ago
Hey! Do you still run into the same issue if you run npx prisma migrate dev?
itchy-amethyst
itchy-amethyst2y ago
Yeah
adverse-sapphire
adverse-sapphire2y 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
itchy-amethyst
itchy-amethyst2y ago
okayy I will try
adverse-sapphire
adverse-sapphire2y ago
@Milan Did it work??
itchy-amethyst
itchy-amethyst2y ago
Noo. do i have to install any dependencies for the adapters?
adverse-sapphire
adverse-sapphire2y ago
no
rare-sapphire
rare-sapphire2y ago
the driver adapaters are only needed if you're using the serverless driver with prisma
itchy-amethyst
itchy-amethyst2y 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 🥲
rare-sapphire
rare-sapphire2y 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?
itchy-amethyst
itchy-amethyst2y ago
not coding it on git just on my vscode editor :))
rare-sapphire
rare-sapphire2y ago
which tutorial were you following?
itchy-amethyst
itchy-amethyst2y ago
twitch clone by codewithantonio he used planetscale but recommended to use this if we can do that
rare-sapphire
rare-sapphire2y 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.
rare-sapphire
rare-sapphire2y 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
itchy-amethyst
itchy-amethyst2y ago
ya i have the same thing in my code rn
rare-sapphire
rare-sapphire2y 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
itchy-amethyst
itchy-amethyst2y ago
do you mean the neon website where i created the db ?
rare-sapphire
rare-sapphire2y ago
yea
itchy-amethyst
itchy-amethyst2y ago
Umm actually have logged in with my mail but i can share the screen if you want?
rare-sapphire
rare-sapphire2y ago
what I meant was the database credentials that are in your .env file
itchy-amethyst
itchy-amethyst2y ago
ohh
rare-sapphire
rare-sapphire2y ago
or you can test with psql if you have it installed on your machine
itchy-amethyst
itchy-amethyst2y ago
yaa sure like the urls?
rare-sapphire
rare-sapphire2y ago
yaa sure like the urls?
yea, and then you can change the password by resetting credentials
itchy-amethyst
itchy-amethyst2y ago
ya its ok this one right?
rare-sapphire
rare-sapphire2y ago
yea this is sensitive info so you shouldn't really share them publicly 😅 you can delete your message haha
itchy-amethyst
itchy-amethyst2y ago
oops you copied? or should i dm?
rare-sapphire
rare-sapphire2y ago
yea I copied and it works
itchy-amethyst
itchy-amethyst2y ago
oukay
rare-sapphire
rare-sapphire2y ago
yea so running both commands worked for me so not sure why it hangs in your case
itchy-amethyst
itchy-amethyst2y ago
huff okay tommorow i will try to re run whole project on diff system and acc or somethin
rare-sapphire
rare-sapphire2y ago
yea all of the tables are there and everything
No description
itchy-amethyst
itchy-amethyst2y ago
i see okay i will try to do it will let you know Thankyou for your time and help :1010: :chefskiss:
rare-sapphire
rare-sapphire2y ago
No problem! Happy learning 😄

Did you find this page helpful?