From d1332ece955ea21fe7dd8370a2236b2c4681761d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Bayo=C3=A1n=20Santiago=20Calder=C3=B3n?= Date: Fri, 29 Jan 2021 14:29:33 -0500 Subject: [PATCH] Add example of setup with pats kwarg Add example to docs. Closes #17. --- src/01_BaseUtils.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/01_BaseUtils.jl b/src/01_BaseUtils.jl index 591ce2a..95fc29d 100644 --- a/src/01_BaseUtils.jl +++ b/src/01_BaseUtils.jl @@ -139,6 +139,11 @@ Sets up your PostgreSQL database for the project. # Example +```julia-repl +julia> setup(pats = [GitHubPersonalAccessToken("MyGH_Login", ENV["GH_PAT"])]) + +``` + ```julia-repl julia> setup() @@ -169,7 +174,7 @@ function setup(;host::AbstractString = get(ENV, "PGHOST", "localhost"), pat = DataFrame(execute(GHOST.PARALLELENABLER.conn, "SELECT login, token FROM $schema.pats ORDER BY login LIMIT 1;")) GHOST.PARALLELENABLER.pat = only(GitHubPersonalAccessToken.(pat.login, pat.token)) catch err - throw(ArgumentError("No PAT was provided nor available in the database.")) + throw(ArgumentError("No PAT was provided nor available in the database. You can provide PAT directly through `setup` using the keyword argument `pats`.")) end else pats = DataFrame((login = pat.login, token = pat.token) for pat in pats)