Closure Tables (SQL)
Created on 2025-04-21T18:33:31-05:00
A closure table stores all transitive relationships in an outline.
- For example nodes may be allowed a single 'parent', but those node can have their own 'parent.'
- Unravelling this relationship requires recursively retrieving elements and picking through their parent or children relationships.
- A closure table stores secondary references to these; such as relating a node to its grandparent
- Closures might also include a 'depth' to make it possible to request only one or two layers of a conversation
- Thus you can query 'all descendents of this node' when pulling a conversation thread or an outline