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

Add debug mode #8

Closed
Ragatzino opened this issue May 20, 2022 · 4 comments
Closed

Add debug mode #8

Ragatzino opened this issue May 20, 2022 · 4 comments

Comments

@Ragatzino
Copy link

Hello, i was really hyped about your tool for documentation :).

I just tried it on my DB and it does not want to do the job :

more than one row in subquery

And i have no clue about what is the problem.

Maybe a --debug flag could be postponed to understand better why it would not work ?

What do you think ?

@KarnerTh
Copy link
Owner

I will see if I can log some useful debug data in the future, a --debug flag seems reasonable.

More important, can you provide the DDL of the tables that caused the problem? If yes I would try to reproduce your error and investigate it

@SvanteRichter
Copy link

A pretty minimal schema to reproduce this seems to be

CREATE TABLE a (id text);
CREATE TABLE b (id text, aid text, PRIMARY KEY (id, aid));
CREATE TABLE c (aid text, bid text, PRIMARY KEY (aid, bid), FOREIGN KEY (aid, bid) REFERENCES b (id, aid));

Looking at the query in the postgresql logs it seems to be resolved by adding a limit to the information_schema.key_column_usage subquery, but I'm not sure if that discards info that is needed down the line

@KarnerTh
Copy link
Owner

Thanks for the reproducible schema - I will investigate the issue

@KarnerTh
Copy link
Owner

KarnerTh commented Jul 1, 2022

I have released a new Version (0.2.0) that fixes the issue (thanks to @SahAssar for providing the schema). I have also added an integration test for that kind of schema and the --debug option.

All changes are documented in the changelog

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

3 participants