Рет қаралды 3,647
Supabase-js provides advanced TypeScript helpers for interacting with your Supabase Postgres Database. Since supabase-js version 2.39 QueryResult, and QueryData types are provided to extract the return type for complex queries such as joins.
- Read the docs: supabase.com/docs/guides/api/...
- Watch the Supabase Tips video: • How to generate TypeSc...
🎙️ Presented by Thor Schaeff (@thorwebdev go.thor.bio/x)
Chapters
00:00 Intro & recap
00:20 New type shorthands and type helpers
00:58 Initialize a new local supabase project
01:10 Create a new init migration
02:13 Create a new Supabase function
02:46 Generate TypeScript types from your database schema
03:21 Start supabase locally and apply the init migration
04:05 New type shorthands for Tables and Enums
04:45 Enable Deno in vscode for Supabase Edge Functions
05:45 Initialize a supabase-js client
07:05 Supply the Database TypeScript types to the client
07:45 Build a simple query in supabase-js
08:37 Use the Table type shorthand
09:35 Get the type for complex tables with QueryData type helper
12:50 QueryResult & QueryError type helpers