In loading, handling and things like that. I don't need to worry about having real data in the database, but I also get the benefit of actually coming over the wire and handling all the, asynchronous things like error handling. And that way I can get the best of both worlds. So I typically just like to mock the database out with C data and that way I can I can pull from the API. But you never had an error handling or the loading state handling in there and initially because you never needed it. Or we didn't handle that error because you forgot to do it because you marked all the data out, and then you went back to replace it with an API. And I think that's where a lot of bugs come in where you're like, we didn't show a loading spinner. So you're always writing a UI that's 100% guaranteed to work. Because you're just reading from memory directly hard coded. But because you're not going over the network, to get that data you kind of miss out on like the error handling and the loading handling of making an API call. Because if you just hard code data, yeah, you can go on and you can build things faster. And I like to do that versus like hard coding data. We also need to talk about the schema, what is going to go into the schema and then what I typically do is I like to write like a seed script to actually see the database with some mock data. So it depends on how you want to get that data and what you're doing. But you can also use it directly in a component, which is kind of weird at the same time. Because the next is there's many places to use database, you can actually use it through an API like you typically do. So what we're gonna do is we need to, one, figure out how we're gonna do the database stuff, and talk about where we're gonna use it. I start doing back end stuff using some pretty cool tools, in my opinion, that I think are really awesome, and make things a lot simpler. Transcript from the "Setup Prisma & PostgreSQL on Heroku" Lesson
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |