Build a Random Quote Machine with Nextjs, PlanetScale MySQL, & Drizzle ORM

preview_player
Показать описание


⭐ Become a full-stack web dev with Zero To Mastery Courses:

👇 Follow Me On Social Media:

Build a Random Quote Machine with Nextjs, PlanetScale MySQL, & Drizzle ORM

(00:00) Intro
(00:18) Welcome
(00:42) PlanetScale
(01:34) Create a MySQL database
(02:47) Create & populate the tables
(10:29) Promote the branch to production
(11:07) Get connection credentials
(15:16) Getting started with Drizzle
(21:19) Introspect for automatic schema generation
(25:54) Create library functions to retrieve the data

📚 Tutorial References:

#nextjs #mysql #drizzle
Рекомендации по теме
Комментарии
Автор

'drizzle-kit' published v 0.19.1 about 6 hours ago. This video was made using "the ancient" drizzle-kit 0.18.1 ;)
Seems like drizzle.config has changed and the top-level `connectionString` gives an error ("connectionString' does not exist in type "). But this works:
```
export default {
schema: "./src/db/schema.ts",
out: "./drizzle",
driver: "mysql2",
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
}
} satisfies Config
```
Hopefully that helps somebody. And another great video, Dave! Great pace, the right amount of detail. You save me so much time. I appreciate you.

misrule
Автор

Hey, it's been some days since i had fun programming and you got that back to me, thank you man, I'm halfway into the tutorial and im learning and having fun again.

martinzutelman
Автор

Thank you for the great tutorial. I was just wondering if you could do another but on NextAuth + PlanetScale + Drizzle in the context of a simple CRUD application? This in my opinion can really set off people to use these tools for larger full stack applications.

theSavanaDev
Автор

bro consistently pushing out bangers brah !

razdingz
Автор

great video your content shows real applications but yet you keep it simple even for someone like me whos never even built a crud app or used a database. i cant state how useful your content is especially when theres so few examples on things like app routing and drizzle orm thank you!

canto
Автор

Hey hey hey, Sunday Dave!
Wonderful tutorial!⭐️

doors
Автор

This was a great tutorial. Can you explain a bit more the difference between getting the data directly with drizzle vs making the API? You mention it around 44:00 and I've seen this done in other tutorials. Get the data in the API and then call the API. But doing it you're way seems much easier. Get the data from the database on the server and use it directly.

thevinman
Автор

So you're telling me the only thing I had to do in order to link tables is eq(), my god, I've tried numerous relations tables but all that seems a bit massy for such a "simple" request. I'll give it a shot, thanks man!

maypact
Автор

Thank you sir Dave! what a great tutorials.

jq_dev
Автор

You are amazing teacher.
You should give a certificate to your students after completing your cources
This will help us alot

ahmedmemon
Автор

Thanks Dave, yesterday I was looking for a tutorial to get me started with Drizzle and Planetscale and here comes your awesome tutorial.🙂

saurabhprakash
Автор

Hey dave you create a "Quote" But is there is automated way to generate types, I means it's hard to keep track of type and I though t drizzle is about types

itsanishjain
Автор

do i really need to attach card for crete database in plant scale

yogeshvanzara
Автор

The configuration options have been updated:
export default {
schema: "./src/db/schema.ts",
out: "./drizzle",
driver: "mysql2",
dbCredentials: {
connectionString: process.env.DATABASE_URL,
}
} satisfies Config

Aleirbag
Автор

Dave, you have awesome content as usual. Thank you so much. One comment though... the spinning transitions are a bit disorienting, imho.

DigitalExtensions
Автор

hi facing issue ts server is very slow, drizzle auto completion is very slow

i am on windows any idea how to fix?

milon
Автор

Hey Dave, comparing this project to the next11 project in your full tutorial. Is the reason we don't have to use revalidation (export const revalidate = 0;) on the index page because we are using the 3rd party ORM to fetch the data and the request is not automatically cached? Just comparing this code to next11 and I noticed that the client component calling router.refresh() requires the ToDo List index page to have this value set or else it doesn't re-render the server component at all. Thanks, learning a lot!

scottsmith
Автор

Grat video, thanks for sharing you knowledge

elliscaicedo
Автор

Nextjs is new to me but I don't understand why there is a need for a REST API in this case? I thought Next code runs on the server side and sends rendered stuff to the client.

roel
Автор

Thanks for all your videos Dave. Wonder if you'd ever consider making Svelte videos too!

kirso