Working with Drizzle ORM in Edge Functions
Supabase Supabase
32.9K subscribers
8,927 views
156

 Published On Jan 3, 2024

Drizzle is a lightweight TypeScript ORM[0] that works on the Edge! In this video we explore how to use Drizzle Kit[1] in combination with the Supabase CLI to manage migrations, as well as run queries in Supabase and Vercel Edge Functions with Drizzle's SQL-like query builder.

- Find the code: https://github.com/thorwebdev/edgy-dr...
- Read the docs: https://supabase.com/docs/guides/data...

Presented by Thor Schaeff (@thorwebdev https://go.thor.bio/x)

[0] https://orm.drizzle.team/
[1] https://orm.drizzle.team/kit-docs/ove...

Chapters
00:00 Intro
01:02 Drizzle kit quickstart
01:49 Set up the schema.ts file
02:49 Set up the drizzle config file
05:19 Generate sql migrations with Drizzle kit
06:35 Run supabase locally
07:01 Create a new table with Drizzle
09:23 Connecting with drizzle in serverless environments
10:24 Create a new supabase function
11:00 Import npm dependencies in Deno
12:30 Create an import map for Edge Function dependencies
14:45 Get the connection string from the env variables
16:00 Run edge function locally
17:00 Link a hosted Supabase project to your local project
17:32 Find the supervisor connection string
18:37 Push local migrations to a hosted supabase project
19:18 Deploy the edge function
20:23 Connecting from Vercel Edge Functions

show more

Share/Embed