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

Invalid links can be generated when not selecting all the tables #223

Closed
palucki opened this issue Apr 29, 2020 · 11 comments · Fixed by #225
Closed

Invalid links can be generated when not selecting all the tables #223

palucki opened this issue Apr 29, 2020 · 11 comments · Fixed by #225
Assignees
Labels
bug Something isn't working

Comments

@palucki
Copy link

palucki commented Apr 29, 2020

What happened

Suppose you have tables A, B, and C.
both A and B point to table C.
If we specify to generate docs only for tables A and B, the link in theese pointing to non existing table C documentation will be generated.

What you expected to happed

Should not create a link to avoid user errors when browsing generated output.
A switch not to generate links at all can do the job as well.

Environment

  • tbls version : 1.37.0
  • postgreSQL database
  • Windows 10
  • config:
comments:
- table: A
  tableComment: table A
- table: B
  tableComment: table B
desc: 'My description'
docPath: doc/schema
dsn: postgres://user:pass@localhost:5432/dbname?sslmode=disable
er:
  skip: true
include:
- A
- B
name: Db overview
@palucki palucki added the bug Something isn't working label Apr 29, 2020
@k1LoW
Copy link
Owner

k1LoW commented Apr 30, 2020

@palucki Thank you for your report !

Could you provide following information ?

  • tbls version
  • Config ( .tbls.yml )

@k1LoW k1LoW self-assigned this Apr 30, 2020
@palucki
Copy link
Author

palucki commented Apr 30, 2020

@k1LoW I've updated the original post to include requested data.
BTW thanks for your great work on that project! It's easily configurable, flexible and really useful in some cases ;)

@k1LoW
Copy link
Owner

k1LoW commented Apr 30, 2020

Thank you !!
Released as v1.37.1

@palucki
Copy link
Author

palucki commented Apr 30, 2020

Unfortunately it looks like the issue is still there or I am misunderstanding something.
I've downloaded 1.37.1
I use the config like this:

include:
- public.tbl_client
exclude:
- public.tbl_account

However my output still have;

td_accid | integer | | true | | [public.tbl_account](public.tbl_account.md) | |

Also is it possible to specify only included tables, and treat all the rest as excluded (and not generate links for them)?

@k1LoW k1LoW reopened this May 1, 2020
@k1LoW
Copy link
Owner

k1LoW commented May 1, 2020

@palucki Oh! I got it !

@palucki
Copy link
Author

palucki commented May 1, 2020

I'll test as soon as the new release is ready.
Do you think it will be feasible / noncomplicated to implement the second request?
Having specified

include:
- public.tbl_client
- public_tbl_bank

generate relations only between the included tables?
So a user do not have to explicitly exclude tables (i.e. tbl_account).

@k1LoW
Copy link
Owner

k1LoW commented May 1, 2020

@palucki

v1.37.2 Released. Could you test this ?

generate relations only between the included tables?

Yes. ( see https://github.com/k1LoW/tbls#filter-tables diagram )

@palucki
Copy link
Author

palucki commented May 1, 2020

@k1LoW , yes, the issue is fixed in 1.37.2 and this item can be closed!
Thanks for your cooperation!

I've got another question (didn't find it in docs). How are child tables generated?
In my scenario using

include:
- public.tbl_A
- public.tbl_B
- public.tbl_C

table A has the tables B and C as children (on id field),
table B has table A as child (on id field)
table C has no children.

Example output for table_A

 id | integer | nextval('tbl_A_id_seq'::regclass) | false | [public.tbl_B](public.tbl_B.md) [public.tbl_C](public.tbl_C.md) |  |  |

They are not connected in db in that way.
Am I missing some configuration or another bug?

@k1LoW
Copy link
Owner

k1LoW commented May 2, 2020

@palucki Thank you for your report !

table A has the tables B and C as children (on id field),
table B has table A as child (on id field)
table C has no children.

Is it an ER diagram like the one below?

schema

They are not connected in db in that way.

You'll need to provide what you expected to happed.

@palucki
Copy link
Author

palucki commented May 2, 2020

I see my post can be misleading, sorry for that. Let me explain:
the tables are not connected in database (so the ER diagram is not valid). Tables a,b,c are totally independent
But still, tbls connects them in a way I presented.

So in the output from tbls:
table A has the tables B and C as children (on id field),
table B has table A as child (on id field)
table C has no children.

This is incorrect. Expected output is that table A, B, C are not in any relation.

Edit: I've tried to reproduce that usiung some minimal example, but for such a setup the output is correct. So let's close this item and I will open another one if I am able to easily reproduce my issue.

@k1LoW
Copy link
Owner

k1LoW commented May 2, 2020

This is incorrect. Expected output is that table A, B, C are not in any relation.

fmfm.

Edit: I've tried to reproduce that usiung some minimal example, but for such a setup the output is correct. So let's close this item and I will open another one if I am able to easily reproduce my issue.

OK!! Thanks for the feedback ! 👍 👍

@k1LoW k1LoW closed this as completed May 2, 2020
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

Successfully merging a pull request may close this issue.

2 participants