1 min read It's Prisma Time · Part 4 of 16

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...

#javascript #typescript #database #orm
Luca Del Puppo Luca Del Puppo
Article Series · Part 4 of 16 It's Prisma Time
View full series (16)
  1. #3 Previous
    Create Table
  2. #4 Reading now
    Create Db
  3. #5 Up next
    Create Relations
Browse all 16 parts in this series
  1. #1 Introduction
  2. #2 Setup
  3. #3 Create Table
  4. #4 Create Db Current
  5. #5 Create Relations
  6. #6 Insert
  7. #7 Delete
  8. #8 Update
  9. #9 Select
  10. #10 Pagination
  11. #11 Aggregate and GroupBy
  12. #12 Transactions
  13. #13 Logging
  14. #14 Execute your own queries
  15. #15 Migrations
  16. #16 Seeding

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 in the GitHub repository

Luca Del Puppo

Written by Luca Del Puppo

Run, Code & Learn

AI Native Engineer at Nearform based in Povegliano (TV), Italy. Google Developer Expert in Web Technologies, GitKraken Ambassador, and Codemotion Ambassador.