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

(cargo-pgrx init) Use toml serializer to write config.toml #1348

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

passcod
Copy link
Contributor

@passcod passcod commented Oct 20, 2023

Writing the toml by formatting strings meant that on Windows, backslashes in paths weren't escaped, outputting invalid toml. This uses the toml crate and the existing ConfigToml struct to read/write the file intead.


Also in the readme it says

If a new minor Postgres version is released in the future you can simply run cargo pgrx init [args] again, and your local version will be updated, preserving all existing databases and configuration.

That was a bit confusing to me, as e.g. running:

$ cargo pgrx init --pg12 download --pg13 download

Followed by

$ cargo pgrx init --pg13 download --pg14 download

Would "erase" the pg12 checkout from the config.toml file, even though the files remained there.

I took that as accidental and fixed it (ie, we read the config and modify it) in this PR, but of course can revert that bit if it was intentional.

@workingjubilee
Copy link
Member

That seems to be correct!

@workingjubilee workingjubilee merged commit 64fbc2e into pgcentralfoundation:develop Oct 22, 2023
9 checks passed
@passcod passcod deleted the write-good-toml branch October 23, 2023 04:07
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.

2 participants