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

Support default Phoenix repo configuration. #1

Open
thruflo opened this issue Mar 4, 2025 · 0 comments
Open

Support default Phoenix repo configuration. #1

thruflo opened this issue Mar 4, 2025 · 0 comments

Comments

@thruflo
Copy link
Contributor

thruflo commented Mar 4, 2025

When you generate a new Phoenix app, it sets the database connection details in dev to something like:

# Configure your database
config :foo, Foo.Repo,
  username: "postgres",
  password: "postgres",
  hostname: "localhost",
  database: "foo_dev",
  stacktrace: true,
  show_sensitive_data_on_connection_error: true,
  pool_size: 10

This then fails with:

config :phoenix_sync,
  mode: :embedded,
  electric: [
    repo: Conductor.Repo
  ]

Because the :port isn't configured:

** (Mix) Could not start application phoenix_sync: Phoenix.Sync.Application.start(:normal, []) returned an error: shutdown: failed to start child: Electric.StackSupervisor
    ** (EXIT) %NimbleOptions.ValidationError{message: "required :port option not found, received options: [:username, :password, :hostname, :database, :sslmode]", key: :port, value: nil, keys_path: [:connection_opts]}

The workaround is to provide the port in the repo config but it would be nice to default this to 5432.

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

No branches or pull requests

1 participant