docs(#15): docs to update db_schema

This commit is contained in:
OllyNicholass
2024-06-19 01:21:36 +01:00
parent c374d686fb
commit 65d33f1f58
+20
View File
@@ -29,6 +29,26 @@ npx supabase start
npx supabase stop npx supabase stop
``` ```
#### Generate schema types (Typescript)
`npx supabase gen types typescript --local > ./src/lib/db_schema.ts`
The overarching `Database` type is used for a generic `SupabaseClient`. This is set globally in `src/app.d.ts`
```ts
import { SupabaseClient } from '@supabase/supabase-js'
import { Database } from '$lib/db_schema'
declare global {
namespace App {
interface Locals {
supabase: SupabaseClient<Database>
...
}
}
}
```
#### Migrations #### Migrations
There are two options to create a migration file: There are two options to create a migration file: