From 693d8120d82f9130bdceb8f7becb69dbbee90de9 Mon Sep 17 00:00:00 2001 From: Michael Fliegner <12422482+michaelfliegner@users.noreply.github.com> Date: Thu, 11 Aug 2022 08:37:57 +0200 Subject: [PATCH 1/2] Update SearchLightPostgreSQL.jl --- src/SearchLightPostgreSQL.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SearchLightPostgreSQL.jl b/src/SearchLightPostgreSQL.jl index a6f7004..9e7d63e 100644 --- a/src/SearchLightPostgreSQL.jl +++ b/src/SearchLightPostgreSQL.jl @@ -59,11 +59,14 @@ Connects to the database and returns a handle. function SearchLight.connect(conn_data::Dict = SearchLight.config.db_config_settings) :: DatabaseHandle dns = String[] - for key in ["host", "hostaddr", "port", "database", "username", "password", "passfile", "connect_timeout", "client_encoding"] + for key in ["host", "hostaddr", "port", "password", "passfile", "connect_timeout", "client_encoding"] get!(conn_data, key, get(ENV, "SEARCHLIGHT_$(uppercase(key))", nothing)) conn_data[key] !== nothing && push!(dns, string("$key=", conn_data[key])) end - + + haskey(conn_data, "database") && push!(dns, string("dbname=", conn_data["database"] + haskey(conn_data, "username") && push!(dns, string("user=", conn_data["username"])) + push!(CONNECTIONS, LibPQ.Connection(join(dns, " ")))[end] end From a64ac8c138c6306259cbd96f8587adc4486249d8 Mon Sep 17 00:00:00 2001 From: Michael Fliegner <12422482+michaelfliegner@users.noreply.github.com> Date: Thu, 11 Aug 2022 08:44:40 +0200 Subject: [PATCH 2/2] Update SearchLightPostgreSQL.jl --- src/SearchLightPostgreSQL.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SearchLightPostgreSQL.jl b/src/SearchLightPostgreSQL.jl index 9e7d63e..0add20a 100644 --- a/src/SearchLightPostgreSQL.jl +++ b/src/SearchLightPostgreSQL.jl @@ -64,7 +64,7 @@ function SearchLight.connect(conn_data::Dict = SearchLight.config.db_config_sett conn_data[key] !== nothing && push!(dns, string("$key=", conn_data[key])) end - haskey(conn_data, "database") && push!(dns, string("dbname=", conn_data["database"] + haskey(conn_data, "database") && push!(dns, string("dbname=", conn_data["database"])) haskey(conn_data, "username") && push!(dns, string("user=", conn_data["username"])) push!(CONNECTIONS, LibPQ.Connection(join(dns, " ")))[end]