3 Minutes with Kent

Prisma is amazing

06.10.2021 - By Kent C. DoddsPlay

Download our free app to listen on your phone

Download on the App StoreGet it on Google Play

Hey there friends. So yesterday I was just a fanboying I guess about

Prisma. If you haven't heard of Prisma, it is a Oh what does that? It's

ORN, I can't remember what what the word for that is but it interfaces

between you and a backend database. So it supports post-grass and SQLite my

sequel and a MongoDB support is coming.

So yeah, just so you have a database and you tell it what database what

kind of,Database you're hitting and how to connect to it or what the

connection URL is. And then it manages connecting to it and you have the

rest of your code doesn't have to worry about what type of database it is.

You just work with Prisma. And what makes Prisma especially special is that

it has a really great way for defining your schema for the types or the

models that your database supports. It has a really nice way of making the

database match that so it'll create the tables for you and everything.

It has a great way for my great.Hitting so if you need to change the column

name or something then it will automate that process and and that can be

part of your deployment pipeline is to alter tables to add columns and

stuff like that. It doesn't quite help you with like breaking changes.

It they have some articles to help, you know, how to go about doing that

and I have successfully done that with Prisma. But yeah, and and it's it's

not like a terribly difficult thing to do necessarily but I mean if it's a

really great big breaking change then having zero downtime is tricky.

But yeah, I've had a couple like the situations where I needed to remove an

enum value and stuff and I was able to do that without too much trouble.

Thanks to a lot to prism as migrate feature, but then the thing that you

experience on a regular basis working with Prisma that just I love is its

type script support.

So you define this schema and then it generates TypeScript types. So that

as you're using Prisma you say Prisma dot and then the,The table that you

want to get and info from and then find many and then you have a select and

aware and an order by and if there's relations so like a user has many

posts or something then you can get all that users posts or if you're

looking for posts, you can get the the author and data from that and it's

all just so nice with TypeScript.

It's it's brilliant. So if you are using one of those databases and you

haven't tried Prisma yet give it a look it is fantastic. I'm really really

happy with it. Hope you're having an awesome day andWe'll talk to you later.

More episodes from 3 Minutes with Kent