You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/supabase.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,73 @@ This is extremely helpful for verifying that your function is running correctly
316
316
317
317
:::
318
318
319
+
### Type Generation
320
+
321
+
Dreamflow can generate fully typed TypeScript definitions based on your database schema. These types ensure your Edge Functions stay in sync with your tables, columns, and relationships, providing safer queries and better autocomplete during development.
322
+
323
+
For example, without types you might accidentally write:
// ❌ Bug: "fullName" is not a column in the profiles table
328
+
```
329
+
330
+
This won’t fail until the app is actually running.
331
+
332
+
With generated types, TypeScript immediately catches the mistake:
333
+
334
+
```tsx
335
+
// ❌ TypeScript error: "fullName" does not exist on type Insert<profiles>
336
+
```
337
+
338
+
Instead of guessing column names or discovering mistakes only at runtime, you get immediate feedback and accurate autocomplete based on your real schema.
339
+
340
+
#### Generate Types from Database Schema
341
+
342
+
You can easily generate the `database.types.ts` file by asking the Dreamflow agent.
343
+
344
+
Use this Agent prompt:
345
+
346
+
```jsx
347
+
Generate a `database.types.ts` file for my connected Supabase project based on the current database schema.
348
+
```
349
+
350
+
:::warning
351
+
Types do not update automatically. You must regenerate them whenever your database schema changes.
352
+
:::
353
+
354
+
#### Use Generated Types
355
+
356
+
Inside any Edge Function, you can import the generated types:
0 commit comments