juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
369 stars 31 forks source link

postgres: add an option exposing connection URI #141

Closed srid closed 7 months ago

srid commented 7 months ago

Instead of:

https://github.com/juspay/services-flake/blob/218fa6cc9a875c20def622e974fb4e0f391b3b6d/example/flake.nix#L54

we want to be able to:

{
  environment.PGWEB_DATABASE_URL = pgcfg.connectionURI { inherit dbName; };
  ...
}

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS