Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 23, 2021 06:51 am GMT

It's Prisma Time - Create Db

Hi Guys
welcome back.
Finally, today it's time to create our database, so don't waste time, and get started.
How can you create your database?
It's simple! You have to run the following script:

npx prisma db push

This script creates in your prisma folder a SQLite database called dev.db.
The database's name is taken from the variable DATABASE_URL in the .env file and inside of the file you can find the next table.
Post Table
Ok, now you have your database so it's time to get back at the challenge left open last article.
Run the script

yarn dev
{ posts: [] }

it's work
Ok, there aren't data but it works
So now you have a database and you can search data inside it, at this point, it's time to create relations between our entities, but it's the goal of the next article

That's all for today guys!
See you soon
Bye Bye

You can find the code relative to this post here


Original Link: https://dev.to/this-is-learning/its-prisma-time-create-db-3e8n

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To