From 490eac5df056d5628af3b75041948d66e3ef714e Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Mon, 8 Aug 2022 02:12:44 +0200 Subject: [PATCH] auto-load adapter package --- Project.toml | 2 +- src/Configuration.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index a71d70e..59e2f9a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SearchLight" uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050" authors = ["Adrian Salceanu "] -version = "2.6.0" +version = "2.6.1" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/Configuration.jl b/src/Configuration.jl index a8dccb2..9ae53cc 100644 --- a/src/Configuration.jl +++ b/src/Configuration.jl @@ -86,10 +86,10 @@ function read_db_connection_data(db_settings_file::String) :: Dict{String,Any} end -function load(path::Union{String,Nothing} = nothing; context = @__MODULE__) :: Dict{String,Any} +function load(path::Union{String,Nothing} = nothing; context::Union{Module,Nothing} = nothing) :: Dict{String,Any} db_config_file = path === nothing ? joinpath(SearchLight.DB_PATH, SearchLight.SEARCHLIGHT_DB_CONFIG_FILE_NAME) : path SearchLight.config.db_config_settings = read_db_connection_data(db_config_file) - Base.eval(context, Meta.parse("using SearchLight$(SearchLight.config.db_config_settings["adapter"])")) + context !== nothing && Base.eval(context, Meta.parse("using SearchLight$(SearchLight.config.db_config_settings["adapter"])")) SearchLight.config.db_config_settings end