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

Using psql command instead of postgres in initialScript #66

Merged
merged 19 commits into from
Dec 24, 2023

Conversation

rsrohitsingh682
Copy link
Member

@rsrohitsingh682 rsrohitsingh682 commented Dec 20, 2023

Resolves : #63

Key changes in this PR:

  • Use psql instead of postgres, as a result use pg_ctl to temporarily start the postgres server in ${name}-init process.
  • Avoid creating a custom postgresPkg with extensions by using apply attribute provided by mkOption
  • Refactor setup script, use writeShellApplication and resolve shell-check errors

…stgres server to start first then load initScript
@shivaraj-bh
Copy link
Member

The CI is going into an infinite loop while running the postgres_test.nix, stopping it for now.

Earlier <name> would depend on <name>-init, now it is the other way round
example/flake.nix Outdated Show resolved Hide resolved
By starting the server temporariliy using pg_ctl we can run the init process
before starting the server. Hence, the <name>-init needn't depend on <name>
anymore

The idea for pg_ctl comes from: https://github.com/cachix/devenv/blob/main/src/modules/services/postgres.nix
get shell-check and be able to provide runtimeInputs (we will use this later)
+ Also don't unset PGHOST, the script fails with unbound variable error
+ Remove the unnecessary comment about PGHOST and PGPORT
@shivaraj-bh
Copy link
Member

@rsrohitsingh682 will merge this today if there is nothing more to add

@shivaraj-bh shivaraj-bh merged commit 22e121b into juspay:main Dec 24, 2023
2 checks passed
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.

Postgres: use psql instead of postgres CLI to load the initialScript
3 participants