From 345026b143c515c6b6586554f6bb753aa3cf1650 Mon Sep 17 00:00:00 2001 From: Greg Rychlewski Date: Fri, 1 Dec 2023 01:37:48 -0500 Subject: [PATCH] Add doc about URL config precedence (#4332) --- lib/ecto/repo.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ecto/repo.ex b/lib/ecto/repo.ex index 08a6f85fc6..55f52f6a6a 100644 --- a/lib/ecto/repo.ex +++ b/lib/ecto/repo.ex @@ -67,8 +67,10 @@ defmodule Ecto.Repo do config :my_app, Repo, url: "ecto://postgres:postgres@localhost/ecto_simple" - The schema can be of any value. The path represents the database name - while options are simply merged in. + The schema can be of any value and the path represents the database name. + The URL will be used generate the relevant Repo configuration values, such + as `:database`, `:username`, `:password`, `:hostname` and `:port`. These + values take precedence over those already specified in the Repo's configuration. URL can include query parameters to override shared and adapter-specific options, like `ssl`, `timeout` and `pool_size`. The following example