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

Use petgraph::algo::tarjan_scc to order the schema graph #1867

Conversation

eeeebbbbrrrr
Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr commented Sep 18, 2024

This seems to give a consistent ordering of the schema through consecutive runs of cargo pgrx schema.

It also allows diff to produce nice diffs when the schema changes compared to a previous version.

Tossing this up here to see if CI blows up on any of the tests or examples due to the schema being out of order.

I've tested this ordering with the pg_search extension (which is quite large) and it still generates a perfectly usable schema. The same one from run to run, even!

It also adds comment markers around each connected block of sql objects, just to help better visualize the connectedness of the schema.

Closes #1866

This seems to give a consistent ordering of the schema through
consecutive runs of `cargo pgrx schema`.

It also produces allows `diff` to produce nice diffs when the schema
changes compared to a previous version
@workingjubilee workingjubilee merged commit a850b36 into pgcentralfoundation:develop Sep 18, 2024
14 checks passed
@eeeebbbbrrrr
Copy link
Contributor Author

Thanks for the merge and your time!

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

Successfully merging this pull request may close these issues.

cargo pgrx schema output isn't repeatable
2 participants