Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example generating self-referential data #441

Open
kevinmichaelchen opened this issue Aug 24, 2023 · 0 comments
Open

Example generating self-referential data #441

kevinmichaelchen opened this issue Aug 24, 2023 · 0 comments

Comments

@kevinmichaelchen
Copy link

kevinmichaelchen commented Aug 24, 2023

Is there an example of a self-referential table?

example: I'm implementing a tree of nodes.

The node table has a nullable parent_id column.

How would I implement trees of arbitrary depth?

Currently, every node is just referencing itself.

{
  "otherStuff": "excludedForBrevity",
  "parent_id": {
    "type": "same_as",
    "ref": "org_unit.content.id"
  }
}

Is there a way to change the ref so it's not referencing its own id column?

@kevinmichaelchen kevinmichaelchen changed the title Example generating self-refential data Example generating self-referential data Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant