Skip to content

Commit

Permalink
auto-load adapter package
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Aug 7, 2022
1 parent f6cbfa7 commit 84022d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SearchLight"
uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050"
authors = ["Adrian Salceanu <[email protected]>"]
version = "2.5.0"
version = "2.6.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
5 changes: 4 additions & 1 deletion src/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

2 comments on commit 84022d6

@essenciary
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/65825

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.6.0 -m "<description of version>" 84022d6f3a5831572ac3ce038a2e4f2f2a02b89c
git push origin v2.6.0

Please sign in to comment.