How to use Prisma Postgres 🚀

Introduction

On October 29, Prisma announced Prisma Postgres. Don’t hesitate to read the blog, useful information! 🙌

It is built from the ground up and deployed via unikernels (think: hyper-specialized OS) that are running as ultra-lightwe…


This content originally appeared on DEV Community and was authored by Thomas Bnt ☕

Introduction

On October 29, Prisma announced Prisma Postgres. Don't hesitate to read the blog, useful information! 🙌

It is built from the ground up and deployed via unikernels (think: hyper-specialized OS) that are running as ultra-lightweight microVMs on our own bare metal servers.

Thanks to that architecture, we’re able to offer unique benefits that you don’t get anywhere else:

  • A “serverless” database with pay-as-you-go pricing but no cold starts.
  • A generous free tier that you can use to explore the service and build small projects.
  • Thanks to the first-class integration with other Prisma products, you also get the following features out-of-the-box:
    • Real-time database event streams
    • Connection pooling
    • Caching
    • Query analysis and recommendations

Quick video presentation

How to use Prisma Postgres

Getting started: Get a new database

If you want, you have the Quickstart documentation about installing Prisma.

  1. Login into your Prisma Console account (it's free)
  2. Create a new project by clicking on the New project button
  3. Give it a beautiful name
  4. In the Prisma Postgres section, click to Get started Prisma Postgres section
  5. Select a region, and click to Create project
  6. You now have your database ! 🥳

Setup your project

  1. Open your terminal
  2. Execute this command if you want a template

    npx try-prisma@latest --template databases/prisma-postgres --name hello-prisma --install npm
    
  3. Install dependencies

    thomasbnt@thomasbnt:~/lab$ npx try-prisma@latest --template databases/prisma-postgres --name beautiful-project --install npm
    Need to install the following packages:
    try-prisma@1.0.58
    Ok to proceed? (y) y
    ✔ Loaded 59 templates
    ✔ Downloaded and extracted the databases/prisma-postgres project in ./beautiful-project.
    ✔ Installed packages in ./beautiful-project.
    The project is good to go! Next steps:
    1. Navigate into ./beautiful-project to begin.
    2. Refer to the project README for detailed instructions on running the project:
    https://github.com/prisma/prisma-examples/tree/latest/databases/prisma-postgres
    If you have any feedback about this specific template, we want to hear it!
    Submit any feedback here: https://pris.ly/prisma-examples-feedback
    thomasbnt@thomasbnt:~/lab$ cd beautiful-project/
    
  4. Click on Generate database credentials and copying and pasting into your .env file in your project folder, but keep it private!
    Files in the project folder

  5. You can setup your database with a migration

    npx prisma migrate dev --name init
    

    Output:
    Output when executing a Prisma migrate command

  6. Optional: If you want sample data: npm run queries

  7. You can now see your database with the npx prisma studio 🚀

Prisma studio with sample data

Useful links

Note: Some links are affiliate links. I may receive a commission when you take a paid offer.


This content originally appeared on DEV Community and was authored by Thomas Bnt ☕


Print Share Comment Cite Upload Translate Updates
APA

Thomas Bnt ☕ | Sciencx (2024-10-31T18:00:00+00:00) How to use Prisma Postgres 🚀. Retrieved from https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/

MLA
" » How to use Prisma Postgres 🚀." Thomas Bnt ☕ | Sciencx - Thursday October 31, 2024, https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/
HARVARD
Thomas Bnt ☕ | Sciencx Thursday October 31, 2024 » How to use Prisma Postgres 🚀., viewed ,<https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/>
VANCOUVER
Thomas Bnt ☕ | Sciencx - » How to use Prisma Postgres 🚀. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/
CHICAGO
" » How to use Prisma Postgres 🚀." Thomas Bnt ☕ | Sciencx - Accessed . https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/
IEEE
" » How to use Prisma Postgres 🚀." Thomas Bnt ☕ | Sciencx [Online]. Available: https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/. [Accessed: ]
rf:citation
» How to use Prisma Postgres 🚀 | Thomas Bnt ☕ | Sciencx | https://www.scien.cx/2024/10/31/how-to-use-prisma-postgres-%f0%9f%9a%80/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.