Dealing with postgres dependencies #11142
bpeck81
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Edit:
I've deprecated this method and wrote a post of what I prefer to do here #11212
Issues with dependencies:
I've been learning postgres as I build my project in supabase and found myself wanting to really lean into using views and functions. The problem is that postgres punishes you for using them without knowing your column schemas ahead of time. To make a change you have to drop cascade, and in my case, I had 30 indirectly dependent objects I was frequently dropping.
I made some functions to help deal with dependencies and take full advantage of views and functions.
I hope this helps save people some of the pain I went through to create a good workflow!
Here's an example of how to use it:
Repo:
https://github.com/bpeck81/dep_postgres
Beta Was this translation helpful? Give feedback.
All reactions