Tree structures support
## Problem <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> Hello! There is no real functionality for working with tree structures recursively. It would be awesome if there was a functionality added to define a model & query the most popular hierarchal data structures for relational databases. But for the sake of simplicity and referential integrity, i think the adjacency list support would be the the best choice for the first solid implementation. ## Suggested solution <!-- A clear and concise description of what you want to happen. --> The first thing that comes to my mind is that there needs to be some kind of way to declare that a model inside a schema wants to be a tree node. Simple example: ```typescript model Category TreeNode { // Or: Tree, TreeNode('adjacencyList'), Tree('adjancencyList') id Int @id @default(autoincrement()) name String // Those fields below could be added behind the scenes based on model declaration above // But that would be dependent on experimental schema migration tool, so idk // Anyways, in the case of basic adjacency list, those could be required children Category[] @relation("CategoryToCategory") parent Category? @relation("CategoryToCategory", fields: [parentId], references: [id]) parentId Int? } ``` Then there should be some methods for working with trees. Some basic ones, as an example: * getDescendants * getAncestors * getChildren * getR
Posted by tasops on Dec 8, 2020, 6:25 PM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Tree structures support
## Problem <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> Hello! There is no real functionality for working with tree structures recursively. It would be awesome if there was a functionality added to define a model & query the most popular hierarchal data structures for relational databases. But for the sake of simplicity and referential integrity, i think the adjacency list support would be the the best choice for the first solid implementation. ## Suggested solution <!-- A clear and concise description of what you want to happen. --> The first thing that comes to my mind is that there needs to be some kind of way to declare that a model inside a schema wants to be a tree node. Simple example: ```typescript model Category TreeNode { // Or: Tree, TreeNode('adjacencyList'), Tree('adjancencyList') id Int @id @default(autoincrement()) name String // Those fields below could be added behind the scenes based on model declaration above // But that would be dependent on experimental schema migration tool, so idk // Anyways, in the case of basic adjacency list, those could be required children Category[] @relation("CategoryToCategory") parent Category? @relation("CategoryToCategory", fields: [parentId], references: [id]) parentId Int? } ``` Then there should be some methods for working with trees. Some basic ones, as an example: * getDescendants * getAncestors * getChildren * getR
Comments (0)
No comments yet. Start the discussion.