Skip to content

Instantly share code, notes, and snippets.

View govi218's full-sized avatar
👾

Govind Mohan govi218

👾
View GitHub Profile
@govi218
govi218 / generate-supabase-enums.md
Created May 6, 2024 05:08 — forked from serhii-levchenko/generate-supabase-enums.md
Generate enums based on Supabase types

Currently Supabase generates only types by default but it can be useful to have enums. That's how you can do it:

  1. Add your own script in package.json e.g. "generate:enums": "node ./scripts/generate-enums.js"

  2. Create ./scripts/generate-enums.js file

const fs = require('fs');
const ts = require('typescript');