Make initdb args configurable
This PR aims to make the arguments for initdb command configurable.
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
Some locale categories must have their values fixed when the database is created. You can use different settings for different databases, but once a database is created, you cannot change them for that database anymore. LC_COLLATE and LC_CTYPE are these categories
I took another look at the test and the output failure, lc_collate and lc_ctype are probably supposed to be in allcaps.
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. Looks like all test passes.
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.
@boustrophedon I just squashed the commits
thread 'buider_setters' panicked at tests/basic_operations.rs:108:10:
failed to execute LC_COLLATE query: Database(PgDatabaseError { severity: Error, code: "42704", message: "unrecognized configuration parameter \"lc_collate\"", detail: None, hint: None, position: None, where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("guc.c"), line: Some(1241), routine: Some("find_option") })
stack backtrace:
well, that's not good https://github.com/boustrophedon/pgtemp/actions/runs/19150293475/job/54738465810