From 84022d6f3a5831572ac3ce038a2e4f2f2a02b89c Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Mon, 8 Aug 2022 01:44:54 +0200 Subject: [PATCH] auto-load adapter package --- Project.toml | 2 +- src/Configuration.jl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index f9c3286..a71d70e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SearchLight" uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050" authors = ["Adrian Salceanu "] -version = "2.5.0" +version = "2.6.0" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/Configuration.jl b/src/Configuration.jl index 9d48894..a8dccb2 100644 --- a/src/Configuration.jl +++ b/src/Configuration.jl @@ -86,9 +86,12 @@ function read_db_connection_data(db_settings_file::String) :: Dict{String,Any} end -function load(path::Union{String,Nothing} = nothing) :: Dict{String,Any} +function load(path::Union{String,Nothing} = nothing; context = @__MODULE__) :: 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"])")) + + SearchLight.config.db_config_settings end