S
Supabase2mo ago
Ben H

how can i edit my database functions in cursor?

I have all my edge functions in my project folder which makes them really easy to edit with Cursor. I can edit the functions, deploy, test, edit, deploy, test, etc. very quickly. However, my database functions live in the Supabase dashboard. This makes them a pain in the ass to edit with Cursor. Is there a way to set it up so that my database functions live in my project folder? That would make them a lot easier to edit. Maybe with migrations? I don't really understand migrations that well lol.
2 Replies
silentworks
silentworks2mo ago
You should learn about migrations if you don't understand them that well. That is the only way to have your db functions locally in a file.
tomaspozo
tomaspozo2mo ago
Checkout declarative db schemas, you declare your functions and schema in files, and then with the cli the migrations are created, but if you need to update your function, you only do it on the schema files... so you only deal with 1 entrypoint https://supabase.com/docs/guides/local-development/declarative-database-schemas#managing-dependencies Also, if using cursor, checkout the provided Supabase cursor rules. There's one for declarative schemas too: https://supabase.com/docs/guides/getting-started/ai-prompts/declarative-database-schema

Did you find this page helpful?