-
Notifications
You must be signed in to change notification settings - Fork 14
Make initdb args configurable #21
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
Conversation
|
Thanks for using pgtemp! This looks fine but I'm wondering in what situations you need to set the config via initdb and not at runtime via the with_config_param option. Incidentally it looks like I intended initially to use the server_configs with both initdb and the actual postgres execution but didn't / forgot to. Would it make more sense to set the existing configs on initdb as well, or is there a usecase where they need to be separate? e.g. testing what happens when a db is created one way but then run with extra options later? |
|
Do the test failures occur for you locally? If not it could be an issue with the version of postgres in github CI |
|
Hey @boustrophedon a use case i can think of is to set the locale which is not possible to set in the server configuration. As for the tests im afk right now, will check and report back if it works locally. |
|
That makes sense and is indeed stated in the documentation https://www.postgresql.org/docs/current/locale.html
I took another look at the test and the output failure, lc_collate and lc_ctype are probably supposed to be in allcaps. |
src/lib.rs
Outdated
| /// Other server configuration data to be set in `postgresql.conf` via `initdb -c` | ||
| pub server_configs: HashMap<String, String>, | ||
| /// Configuration parameters to be passed to `initdb` command | ||
| pub initdb_configs: HashMap<String, String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this and the function name to be arguments or args? e.g. initdb_args and with_initdb_arg, and update the documentation to mention they're direct arguments to the initdb binary (and not postgres configs that get written to the conf file, as with -c)
|
Hi, it looks good except that the test is still failing because the method name wasn't changed in the test. Could you squash all the commits as well when you have the tests passing? Thanks! |
|
@boustrophedon just fixed all of it, Ran cargo test this time 😅 and sorry for earlier. |
|
Hi @boustrophedon, is there any work pending to merge this PR? Can I help? |
|
Hi, I've been busy with work. This looks good except the commits still need to be squashed. |
08a95d4 to
6e03811
Compare
|
@boustrophedon I just squashed the commits |
well, that's not good https://github.com/boustrophedon/pgtemp/actions/runs/19150293475/job/54738465810 |
This PR aims to make the arguments for initdb command configurable.