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

Process Compose support multiple databases in a monorepo environment #1533

Open
rhodee opened this issue Oct 17, 2024 · 0 comments
Open

Process Compose support multiple databases in a monorepo environment #1533

rhodee opened this issue Oct 17, 2024 · 0 comments
Labels
question Further information is requested

Comments

@rhodee
Copy link

rhodee commented Oct 17, 2024

Greetings,

What is the best current practice for the "DB per service" model using Devenv's monorepo support?

I currently have something like two devenv.sh files for two services:

  services.postgres."service1" = {
    enable = true;
    package = pkgs.postgresql;
    settings = {
      max_connections = 100;
      wal_level = "logical";
      max_wal_size = "1GB";
      min_wal_size = "80MB";
    };

    initialDatabases = [
      {
        name = "svc";
        user = "svcdba";
        pass = "p@ss1234";
      }
    ];
  };

This does not work. When I declare a services.postgres.svc and another block in a different directory, it returns an error:

       error: The option `services.postgres.service2' does not exist. Definition values:
       - In `.../my_service1/devenv.nix':

Can devenv up be configured to merge configs of each PG instance? This would be similar to services-flake behavior here I think.

The use case I have in mind needs to enable a DB per service (1:1). All services are in a single repo, with a devenv.sh at the root and one per service. It would be sufficient if a single services.postgres could be started at the root, and multiple databases could be define via each service's respective devenv.sh.

How can I set it up using devenv.sh?

@rhodee rhodee added the question Further information is requested label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant