glaredb icon indicating copy to clipboard operation
glaredb copied to clipboard

Add dependencies between catalog entries

Open scsmithr opened this issue 3 years ago • 5 comments

Summary

Some entries rely on other entries. We already have the parent_id in EntryMeta, which provides a direct parent/child relationship.

We'll want to track other types of relationships as well. For example, creating an external table foo using connection bar means that foo is dependent on bar. Importantly this means that bar cannot be dropped before foo is dropped (or us on cascade ...). These are the type of dependencies we need to track.

I do not know what the implementation for this looks like. DuckDB and Postgres may be helpful here.

Specifications

  • Add dependencies between catalog entries.
  • Prevent dropping entries if other entries depend on it.

Rationale

Correctness.

Impact

Tasks

scsmithr avatar Jan 25 '23 18:01 scsmithr

Check back mid Feb

greyscaled avatar Jan 30 '23 16:01 greyscaled

Circle back when drop is ready

cc @RustomMS

greyscaled avatar Jan 30 '23 16:01 greyscaled

Edit: Soft blocks on #550 #576

greyscaled avatar Feb 11 '23 20:02 greyscaled

Would be other way around. Having dependencies would allow us to enforce not being able to drop connections that other tables depend on. Even then, I would say this is a strict blocker for either of those other issues if we're fine with potentially broken tables, which we can clean up later.

scsmithr avatar Feb 11 '23 20:02 scsmithr

Thanks for clarification - I'm unsure of the risks of dropping tables without constraints or cascades, but I get that DROP support is multi-faceted just considering this and those issues.

greyscaled avatar Feb 11 '23 20:02 greyscaled