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

Error when referencing itsself #593

Open
uvulpos opened this issue Jun 7, 2024 · 4 comments
Open

Error when referencing itsself #593

uvulpos opened this issue Jun 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@uvulpos
Copy link

uvulpos commented Jun 7, 2024

What happened

I have a database with a role. A role can inherit from another role. Like for example the role chef inherits permissions from the role cook like using_knife or use_stove. But chef also have additional roles like buy_groceries. When cook gets a new role, chef should get it too. So I have a reference to itself

What you expected to happened

An arrow on the side to itself. Maybe even colorful to see its referencing to itsself. But not bothering other innocent tables

What stack trace or error message from tbls did you see?

none.

Anything else we need to know?

Screenshot 2024-06-08 at 00 15 48

Environment

  • tbls version: 1.76.0
  • Database version: postgres latest
  • OS macOS Sonomo... something
  • Config ( .tbls.yml ):
# .tbls.yml

# DSN (Database Source Name) to connect database
dsn: postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable

# Path to generate document
# Default is `dbdoc`
docPath: ./doc/schema

include:
   - public.*

Sql Command:

CREATE TABLE IF NOT EXISTS roles (
    id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
    name VARCHAR UNIQUE NOT NULL,
    inherit_from UUID,
    FOREIGN KEY (inherit_from) REFERENCES roles(id) ON DELETE SET NULL,
    CHECK (inherit_from <> id)
);
@uvulpos uvulpos added the bug Something isn't working label Jun 7, 2024
@uvulpos
Copy link
Author

uvulpos commented Jun 7, 2024

Just out of curiosity: Is there a flag to make these comments less... interfering?
Screenshot 2024-06-08 at 00 27 01

@k1LoW
Copy link
Owner

k1LoW commented Jun 8, 2024

The drawing of ER diagrams relies on Graphviz and there is no such flag at present.

If you find a way to support this in Graphviz, please let us know!

@uvulpos
Copy link
Author

uvulpos commented Jun 9, 2024

@uvulpos
Copy link
Author

uvulpos commented Jun 9, 2024

can someone support here and give some insights?
https://gitlab.com/graphviz/graphviz/-/issues/2554#note_1941974571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants