From 526ca4846cd70e2d0bbd7f2b048b587b58450d48 Mon Sep 17 00:00:00 2001 From: TheCedarPrince Date: Thu, 23 Feb 2023 15:53:56 -0500 Subject: [PATCH 01/24] Attempt to fix JDBC dispatch for DBInterface --- src/jdbc.jl | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/jdbc.jl b/src/jdbc.jl index 1627904..51b6eb8 100644 --- a/src/jdbc.jl +++ b/src/jdbc.jl @@ -8,23 +8,33 @@ function DBInterface.connect(::Type{JDBC.Connection}, args...; connection_string catch println("JVM already initialized") end - JDBC.Connection(connection_string) + JDBC.DriverManager.getConnection(connection_string) end """ -Dispatch for LibPQ interface to DBInterface `prepare` function -TODO: Not fully implemented yet +Dispatch for JDBC interface to DBInterface `prepare` function +BUG: Doesn't seem to work for all JDBC versions yet """ -# DBInterface.prepare(conn::JDBC.Connection, args...; kws...) = -# JDBC.prepareStatement(conn, args...; kws...) +function DBInterface.prepare(conn::JDBC.JavaObject{Symbol("java.sql.Connection")}, args...; kws...) + stmt = JDBC.createStatement(conn) + result = executeQuery(stmt, args...) + return result +end + +""" +Workaround for JDBC interface to DBInterface's `execute` function +""" +function DBInterface.execute(conn::JDBC.JavaObject{Symbol("java.sql.ResultSet")}, args...; kws...) + JDBC.Source(conn) +end """ -Workaround for LibPQ interface to DBInterface's `execute` function +Workaround for JDBC interface to DBInterface's `execute` function """ -function DBInterface.execute(conn::Union{JDBC.Connection, JDBC.JPreparedStatement}, args...; kws...) - csr = JDBC.cursor(conn) - JDBC.execute!(csr, args..., kws...) - JDBC.Source(csr) +function DBInterface.execute(conn::JDBC.JavaObject{Symbol("java.sql.Connection")}, args...; kws...) + stmt = JDBC.createStatement(conn) + result = executeQuery(stmt, args...) + JDBC.Source(result) end From 9ea3bd1a24b425d0d865fbbae12cf603ce5e3eb7 Mon Sep 17 00:00:00 2001 From: Farreeda <94711213+Farreeda@users.noreply.github.com> Date: Fri, 17 Mar 2023 11:34:19 +0200 Subject: [PATCH 02/24] Creating test for _dbconnect function of SQLite fixing the file path issue by identifying its type to String - testing it(Passed) --- .vscode/extensions.json | 5 +++++ .vscode/settings.json | 0 src/sqlite.jl | 6 +++--- test/runtests.jl | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c494538 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "julialang.language-julia" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e69de29 diff --git a/src/sqlite.jl b/src/sqlite.jl index a35d5ad..04b0fcc 100644 --- a/src/sqlite.jl +++ b/src/sqlite.jl @@ -1,5 +1,5 @@ -function _dbconnect(connector::Type{SQLite.DB}; file_path) - - return connector(file_path.second) +function _dbconnect(connector::Type{SQLite.DB}, file_path::String) + return connector(file_path) + end diff --git a/test/runtests.jl b/test/runtests.jl index 35f99ea..c9684dd 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,3 +2,8 @@ using Test, Example @test hello("Julia") == "Hello, Julia" @test domath(2.0) ≈ 7.0 + +@testset "_dbconnect function for SQLite" begin + conn= _dbconnect(SQLite.DB, "path_to_database.db") + @test @isdefined conn +end From ccb0995fbbf49a629494a6047f4972d26dc967f7 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Fri, 17 Mar 2023 11:44:52 +0200 Subject: [PATCH 03/24] fixing the file_path issue --- src/sqlite.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sqlite.jl b/src/sqlite.jl index 04b0fcc..d2cccd5 100644 --- a/src/sqlite.jl +++ b/src/sqlite.jl @@ -1,5 +1,6 @@ + function _dbconnect(connector::Type{SQLite.DB}, file_path::String) return connector(file_path) - + end From 9f01623cec4e6df7671acf13d7fb899734965a4c Mon Sep 17 00:00:00 2001 From: Farreeda Date: Fri, 17 Mar 2023 11:59:46 +0200 Subject: [PATCH 04/24] . --- src/sqlite.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sqlite.jl b/src/sqlite.jl index d2cccd5..db31dd4 100644 --- a/src/sqlite.jl +++ b/src/sqlite.jl @@ -1,4 +1,3 @@ - function _dbconnect(connector::Type{SQLite.DB}, file_path::String) return connector(file_path) From 8c812300686ceccfd05a24651cf5abf2dbccd488 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sat, 18 Mar 2023 08:20:19 +0200 Subject: [PATCH 05/24] updating PR removed .vscode folder added --- .vscode/extensions.json | 5 ----- .vscode/settings.json => test/data/database.db | 0 test/runtests.jl | 4 +++- 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 .vscode/extensions.json rename .vscode/settings.json => test/data/database.db (100%) diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index c494538..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "recommendations": [ - "julialang.language-julia" - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/test/data/database.db similarity index 100% rename from .vscode/settings.json rename to test/data/database.db diff --git a/test/runtests.jl b/test/runtests.jl index c9684dd..1b944cb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,6 +4,8 @@ using Test, Example @test domath(2.0) ≈ 7.0 @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "path_to_database.db") + + conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/database.db") @test @isdefined conn + end From 5629e7e69b70c733919c32b064ada22154b28229 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 19 Mar 2023 10:37:13 +0200 Subject: [PATCH 06/24] Edit function and test --- src/mysql.jl | 7 +++++-- test/runtests.jl | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/mysql.jl b/src/mysql.jl index 151c87e..0075238 100644 --- a/src/mysql.jl +++ b/src/mysql.jl @@ -1,5 +1,8 @@ -function _dbconnect(conn_obj::Type{MySQL.Connection}, kwargs) +function _dbconnect(conn_obj::Type{MySQL.Connection}, host::String, user::String, password::String; db::String="", port::Integer=3306, unix_socket::Union{Nothing,String}=nothing, client_flag=API.CLIENT_MULTI_STATEMENTS, opts = Dict()) - return DBInterface.connect(conn_obj; kwargs...) + if unix_socket == nothing + unix_socket = API.MYSQL_DEFAULT_SOCKET + end + return DBInterface.connect(conn_obj,host, user, password, db=db, port=port, unix_socket=unix_socket, client_flag=client_flag, opts=opts ) end diff --git a/test/runtests.jl b/test/runtests.jl index 1b944cb..a9d28fe 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,5 @@ using Test, Example +using MySQL,SQLite, MySQL.API @test hello("Julia") == "Hello, Julia" @test domath(2.0) ≈ 7.0 @@ -9,3 +10,13 @@ using Test, Example @test @isdefined conn end + +@testset "_dbconnect function for MySQL" begin + + conn = _dbconnect(MySQL.Connection, "localhost", "debian-sys-maint","HGGsOLypO2LVqq1v", db="mydatabase", port=3306, unix_socket="/var/run/mysqld/mysqld.sock") + @test typeof(conn) == MySQL.Connection + @test isopen(conn) + close(conn) + +end + \ No newline at end of file From 163e62254b6e42d941393fa95e98fc5c44d2727c Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 20 Mar 2023 23:13:00 +0200 Subject: [PATCH 07/24] documentation --- docs/make.jl | 22 ++++++++++++++++-- docs/src/Functions.md | 54 +++++++++++++++++++++++++++++++++++++++++++ docs/src/index.md | 3 +++ 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 docs/src/Functions.md diff --git a/docs/make.jl b/docs/make.jl index fd29b00..a5b6b80 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,23 @@ using Documenter, Example -makedocs(modules = [Example], sitename = "Example.jl") +makedocs(; + modules = [DBConnector], + authors = "Jacob Zelko (aka TheCedarPrince) and Fareeda", + repo = "https://github.com/JuliaDatabases/DBConnector.jl", + sitename = "DBConnector.jl", + format = Documenter.HTML(; + prettyurls = get(ENV, "CI", "false") == "true", + canonical = "https://github.com/JuliaDatabases/DBConnector.jl" + edit_link = "dev", + footer = "Created by [Jacob Zelko](https://jacobzelko.com) & [Georgia Tech Research Institute](https://www.gtri.gatech.edu). [License](https://github.com/JuliaHealth/OMOPCDMCohortCreator.jl/blob/main/LICENSE)" + ), + pages = [ + "Home" => "index.md", + "Functions" => "Functions.md" + ], -deploydocs(repo = "github.com/quinnj/Example.jl.git", push_preview = true) +) +deploydocs(repo = "github.com/quinnj/Example.jl.git", + push_preview = true, + devbranch = "main", + ) diff --git a/docs/src/Functions.md b/docs/src/Functions.md new file mode 100644 index 0000000..19bebe4 --- /dev/null +++ b/docs/src/Functions.md @@ -0,0 +1,54 @@ +# Functions + +```@contents +Pages = ["Functions.md"] +``` + +## _dbconnect() + +This Function is dedicated to expand the range of connection between The [OMOPCDMCohortCreator](https://github.com/JuliaHealth/OMOPCDMCohortCreator.jl) with databases. +Databases exist are SQLite, MySQL, PostgreSQL. +In the upcoming sections, we will learn about these tools. + +### SQLite + +Assuming your data exists on a SQLite database and you want to connect it to the OMOPCDMCohortCreator. + +calling the function + +``` _dbconnect(SQLite.Connection,"path/to/database.db") ``` + + + +### MySQL + +Assuming your data exists on a MySQL database and you want to connect it to the OMOPCDMCohortCreator. + +Make sure that the server is running and using `MySQL.API`: + +``` systemctl status mysql ``` + +calling the function + +``` _dbconnect(MySQL.Connection, "host_name", "username", "password"; db = "database_name" , port = port_num, unix_socket = "unix_socket_data_path" ) ``` + +those parameters must exist: + +- host_name : if you are working on same machine server it will be "local host" + +- username +- password + +Can be known by openning all the `.cnf` files until you find them. I wasn't lucky and opened around 5 till I found the right one. Don't give up! + +If unix_socket is not inserted, the default one is given + + + +For any struggles MySQL related, [Read this](https://dev.mysql.com/doc/refman/8.0/en/starting-server.html) + + + + + + diff --git a/docs/src/index.md b/docs/src/index.md index b1cee35..5d6f4db 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -5,3 +5,6 @@ Example Julia package repo. ```@autodocs Modules = [Example] ``` + + + From 954d9f71358447da89c68d5f538c7c1edd19886f Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 26 Jun 2023 16:32:11 +0300 Subject: [PATCH 08/24] removing unwanted files --- .gitignore | 7 ------- docs/make.jl | 2 +- test/data/{database.db => sqlite.db} | 0 test/runtests.jl | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 .gitignore rename test/data/{database.db => sqlite.db} (100%) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b48b360..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*.jl.cov -*.jl.*.cov -*.jl.mem -.DS_Store -/docs/build/ -/docs/Manifest.toml -/Manifest.toml \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index a5b6b80..3c7736b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -19,5 +19,5 @@ makedocs(; ) deploydocs(repo = "github.com/quinnj/Example.jl.git", push_preview = true, - devbranch = "main", + ) diff --git a/test/data/database.db b/test/data/sqlite.db similarity index 100% rename from test/data/database.db rename to test/data/sqlite.db diff --git a/test/runtests.jl b/test/runtests.jl index a9d28fe..914559e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,8 +1,6 @@ using Test, Example using MySQL,SQLite, MySQL.API -@test hello("Julia") == "Hello, Julia" -@test domath(2.0) ≈ 7.0 @testset "_dbconnect function for SQLite" begin From d5a65ac7b84e5a1c31792e7b207edcd8b46ea225 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sat, 1 Jul 2023 18:52:48 +0300 Subject: [PATCH 09/24] trying github secrets --- .github/workflows/ci.yml | 10 ++++++++++ src/mysql.jl | 2 ++ src/postgresql.jl | 20 +++++++++++++++++++- test/runtests.jl | 18 ++++++++++++++---- 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e978134..5a3cece 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,16 @@ jobs: ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 + env: + mysqluser: "${{secrets.MYSQL_USER}}" + mysqlhost: "${{secrets.MYSQL_HOST}}" + mysqlport: ${{secrets.MYSQL_PORT}} + mysqlpassword: "${{secrets.MYSQL_PASSWORD}}" + postgresuser: "${{secrets.POSTGRES_USER}}" + postgreshost: "${{secrets.POSTGRES_HOST}}" + postgresport: ${{secrets.POSTGRES_PORT}} + postgrespassword: "${{secrets.POSTGRES_PASSWORD}}" + - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: diff --git a/src/mysql.jl b/src/mysql.jl index 0075238..a477106 100644 --- a/src/mysql.jl +++ b/src/mysql.jl @@ -1,3 +1,4 @@ + function _dbconnect(conn_obj::Type{MySQL.Connection}, host::String, user::String, password::String; db::String="", port::Integer=3306, unix_socket::Union{Nothing,String}=nothing, client_flag=API.CLIENT_MULTI_STATEMENTS, opts = Dict()) if unix_socket == nothing @@ -6,3 +7,4 @@ function _dbconnect(conn_obj::Type{MySQL.Connection}, host::String, user::String return DBInterface.connect(conn_obj,host, user, password, db=db, port=port, unix_socket=unix_socket, client_flag=client_flag, opts=opts ) end + diff --git a/src/postgresql.jl b/src/postgresql.jl index 7eb6293..61af366 100644 --- a/src/postgresql.jl +++ b/src/postgresql.jl @@ -1,10 +1,12 @@ """ Dispatch for LibPQ interface to DBInterface `connect` function; not supported in LibPQ.jl package currently + """ DBInterface.connect(::Type{LibPQ.Connection}, args...; kws...) = LibPQ.Connection(args...; kws...) -function _dbconnect(conn_obj::Type{LibPQ.Connection}; kwargs...) +function _dbconnect(conn_obj::Type{LibPQ.Connection}, host::String, user::String, password::String; db::String="", port::Integer=3306, unix_socket::Union{Nothing,String}=nothing, client_flag=API.CLIENT_MULTI_STATEMENTS, opts = Dict()) + conn_string = "" for k in kwargs conn_string = conn_string * "$(string(k.first))=$(k.second) " @@ -16,6 +18,13 @@ function _dbconnect(conn_obj::Type{LibPQ.Connection}; kwargs...) end +function _dbconnect(conn_obj::Type{LibPQ.Connection}, host::String, user::String, password::String; db::String="", port::Integer=3306, unix_socket::Union{Nothing,String}=nothing, opts = Dict()) + + return DBInterface.connect(conn_obj, "postgresql://$user:$password@$host:$port/$dbname?user=$user") + +end + + """ Workaround for LibPQ interface to DBInterface's `prepare` function; not supported in LibPQ.jl package currently """ @@ -29,3 +38,12 @@ DBInterface.execute(conn::Union{LibPQ.Connection, LibPQ.Statement}, args...; kws LibPQ.execute(conn, args...; kws...) + conn = LibPQ.Connection( + host="localhost", + port=5432, + dbname="mimic", + user="postgres", + password="postgres3" + ) + conn = LibPQ.Connection("postgresql://postgres:postgres3@localhost:5432/mimic") +] \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 914559e..0b0a748 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,20 +1,30 @@ -using Test, Example +using Test using MySQL,SQLite, MySQL.API + + @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/database.db") + conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/sqlite.db") @test @isdefined conn end @testset "_dbconnect function for MySQL" begin - conn = _dbconnect(MySQL.Connection, "localhost", "debian-sys-maint","HGGsOLypO2LVqq1v", db="mydatabase", port=3306, unix_socket="/var/run/mysqld/mysqld.sock") + conn = _dbconnect(MySQL.Connection, mysqlhost, mysqluser,mysqlpassword, db="MySQL", port=mysqlport) + @test typeof(conn) == MySQL.Connection @test isopen(conn) close(conn) end - \ No newline at end of file + +@testset "_dbconnect function for LibPQ" begin + + #conn = LibPQ.Connection("postgresql://postgres:postgres3@localhost:5432/mimic?user=postgres") + conn= _dbconnect(LibPQ.Connection, postgreshost, postgresuser, postgrespassword, db = "mimic", port=postgresport) + @test @isdefined conn + +end \ No newline at end of file From 1612cf6f9634b5d53d5ecf7874882c32e58e30fd Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sat, 1 Jul 2023 21:01:24 +0300 Subject: [PATCH 10/24] Update for github secrets in julia script --- test/runtests.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 0b0a748..c2df714 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,7 +13,7 @@ end @testset "_dbconnect function for MySQL" begin - conn = _dbconnect(MySQL.Connection, mysqlhost, mysqluser,mysqlpassword, db="MySQL", port=mysqlport) + conn = _dbconnect(MySQL.Connection, ENV[mysqlhost], ENV[mysqluser], ENV[mysqlpassword], db="MySQL", port=ENV[mysqlport]) @test typeof(conn) == MySQL.Connection @test isopen(conn) @@ -23,8 +23,7 @@ end @testset "_dbconnect function for LibPQ" begin - #conn = LibPQ.Connection("postgresql://postgres:postgres3@localhost:5432/mimic?user=postgres") - conn= _dbconnect(LibPQ.Connection, postgreshost, postgresuser, postgrespassword, db = "mimic", port=postgresport) + conn= _dbconnect(LibPQ.Connection, ENV[postgreshost], ENV[postgresuser], ENV[postgrespassword], db = "mimic", port=ENV[postgresport]) @test @isdefined conn end \ No newline at end of file From 48a66d9205a5471dc5ae1c2bed9daa8ea17cb7fd Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sat, 1 Jul 2023 21:21:10 +0300 Subject: [PATCH 11/24] updating github secrets --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index c2df714..ed35c4e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,7 +13,7 @@ end @testset "_dbconnect function for MySQL" begin - conn = _dbconnect(MySQL.Connection, ENV[mysqlhost], ENV[mysqluser], ENV[mysqlpassword], db="MySQL", port=ENV[mysqlport]) + conn = _dbconnect(MySQL.Connection, ENV['mysqlhost'], ENV['mysqluser'], ENV['mysqlpassword'], db="MySQL", port=ENV['mysqlport']) @test typeof(conn) == MySQL.Connection @test isopen(conn) @@ -23,7 +23,7 @@ end @testset "_dbconnect function for LibPQ" begin - conn= _dbconnect(LibPQ.Connection, ENV[postgreshost], ENV[postgresuser], ENV[postgrespassword], db = "mimic", port=ENV[postgresport]) + conn= _dbconnect(LibPQ.Connection, ENV['postgreshost'], ENV['postgresuser'], ENV['postgrespassword'], db = "mimic", port=ENV['postgresport']) @test @isdefined conn end \ No newline at end of file From faa502ab23c37042e5040840305e744efe714a17 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sat, 1 Jul 2023 21:37:00 +0300 Subject: [PATCH 12/24] updates --- .github/workflows/ci.yml | 4 ++-- src/postgresql.jl | 14 ++------------ test/runtests.jl | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a3cece..ed9718f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,11 +49,11 @@ jobs: env: mysqluser: "${{secrets.MYSQL_USER}}" mysqlhost: "${{secrets.MYSQL_HOST}}" - mysqlport: ${{secrets.MYSQL_PORT}} + #mysqlport: ${{secrets.MYSQL_PORT}} mysqlpassword: "${{secrets.MYSQL_PASSWORD}}" postgresuser: "${{secrets.POSTGRES_USER}}" postgreshost: "${{secrets.POSTGRES_HOST}}" - postgresport: ${{secrets.POSTGRES_PORT}} + #postgresport: ${{secrets.POSTGRES_PORT}} postgrespassword: "${{secrets.POSTGRES_PASSWORD}}" - uses: julia-actions/julia-processcoverage@v1 diff --git a/src/postgresql.jl b/src/postgresql.jl index 61af366..d02d1b5 100644 --- a/src/postgresql.jl +++ b/src/postgresql.jl @@ -19,8 +19,9 @@ function _dbconnect(conn_obj::Type{LibPQ.Connection}, host::String, user::String end function _dbconnect(conn_obj::Type{LibPQ.Connection}, host::String, user::String, password::String; db::String="", port::Integer=3306, unix_socket::Union{Nothing,String}=nothing, opts = Dict()) + #conn = LibPQ.Connection("postgresql://postgres:postgres3@localhost:5432/mimic?user=postgres") - return DBInterface.connect(conn_obj, "postgresql://$user:$password@$host:$port/$dbname?user=$user") + return DBInterface.connect(conn_obj, "postgresql://$user:$password@$host:$port/$db?user=$user") end @@ -36,14 +37,3 @@ Workaround for LibPQ interface to DBInterface's `execute` function; not supporte """ DBInterface.execute(conn::Union{LibPQ.Connection, LibPQ.Statement}, args...; kws...) = LibPQ.execute(conn, args...; kws...) - - - conn = LibPQ.Connection( - host="localhost", - port=5432, - dbname="mimic", - user="postgres", - password="postgres3" - ) - conn = LibPQ.Connection("postgresql://postgres:postgres3@localhost:5432/mimic") -] \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index ed35c4e..c201d75 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,7 +13,7 @@ end @testset "_dbconnect function for MySQL" begin - conn = _dbconnect(MySQL.Connection, ENV['mysqlhost'], ENV['mysqluser'], ENV['mysqlpassword'], db="MySQL", port=ENV['mysqlport']) + conn = _dbconnect(MySQL.Connection, ENV['mysqlhost'], ENV['mysqluser'], ENV['mysqlpassword'], db="MySQL", port= 3306) @test typeof(conn) == MySQL.Connection @test isopen(conn) @@ -23,7 +23,7 @@ end @testset "_dbconnect function for LibPQ" begin - conn= _dbconnect(LibPQ.Connection, ENV['postgreshost'], ENV['postgresuser'], ENV['postgrespassword'], db = "mimic", port=ENV['postgresport']) + conn= _dbconnect(LibPQ.Connection, ENV['postgreshost'], ENV['postgresuser'], ENV['postgrespassword'], db = "mimic", port= 5432) @test @isdefined conn end \ No newline at end of file From 82a41ccd7d41b0ed323e4698164cbcbd644a1585 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:04:27 +0300 Subject: [PATCH 13/24] step 1 --- .github/workflows/ci.yml | 11 +--------- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed9718f..6bd2bec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,16 +46,7 @@ jobs: ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - env: - mysqluser: "${{secrets.MYSQL_USER}}" - mysqlhost: "${{secrets.MYSQL_HOST}}" - #mysqlport: ${{secrets.MYSQL_PORT}} - mysqlpassword: "${{secrets.MYSQL_PASSWORD}}" - postgresuser: "${{secrets.POSTGRES_USER}}" - postgreshost: "${{secrets.POSTGRES_HOST}}" - #postgresport: ${{secrets.POSTGRES_PORT}} - postgrespassword: "${{secrets.POSTGRES_PASSWORD}}" - + - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ee4dc7b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: env_tutorial +## Triggers the workflow on when there is a push, or +## pull request on the main branch +on: [pull_request, push] + +env: + ## Sets environment variable + API_KEY: XXXXXXXXXXXX + mysqluser: fareeda + mysqlhost: localhost + #mysqlport: ${{secrets.MYSQL_PORT}} + mysqlpassword: GSoCPass + postgresuser: postgres + postgresuser: static-65.155.180.199.ops.subrigo.net + #postgresport: ${{secrets.POSTGRES_PORT}} + postgrespassword: postgres3 + + +jobs: + job1: + ## The type of runner that the job will run on, + ## here it runs on ubuntu latest + runs-on: ubuntu-latest + steps: + - name: step 1 + ## Reference your environment variables + run: echo "The API key is:${{env.API_KEY}} The mysqluser:${{env.mysqluser}} + mysqlhost: ${{env.mysqlhost}} + mysqlpassword: ${{env.mysqlpassword}} + postgresuser: ${{env.postgresuser}} + postgreshost: ${{env.postgreshost}} + postgrespassword: ${{env.postgrespassword}}" + + + job2: + runs-on: ubuntu-latest + steps: + - name: step 1 + ## Another way reference your environment variables + run: echo "The API key is:$API_KEY , The mysqluser: $mysqluser + mysqlhost: $mysqlhost + mysqlpassword: $mysqlpassword + postgresuser: $postgresuser + postgreshost: $postgreshost + postgrespassword: $postgrespassword" \ No newline at end of file From 8de99b7152f69decd964e45e038065c724b5030d Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:08:02 +0300 Subject: [PATCH 14/24] as the tutorial --- .github/workflows/main.yml | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee4dc7b..7e158e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,15 +6,6 @@ on: [pull_request, push] env: ## Sets environment variable API_KEY: XXXXXXXXXXXX - mysqluser: fareeda - mysqlhost: localhost - #mysqlport: ${{secrets.MYSQL_PORT}} - mysqlpassword: GSoCPass - postgresuser: postgres - postgresuser: static-65.155.180.199.ops.subrigo.net - #postgresport: ${{secrets.POSTGRES_PORT}} - postgrespassword: postgres3 - jobs: job1: @@ -24,22 +15,11 @@ jobs: steps: - name: step 1 ## Reference your environment variables - run: echo "The API key is:${{env.API_KEY}} The mysqluser:${{env.mysqluser}} - mysqlhost: ${{env.mysqlhost}} - mysqlpassword: ${{env.mysqlpassword}} - postgresuser: ${{env.postgresuser}} - postgreshost: ${{env.postgreshost}} - postgrespassword: ${{env.postgrespassword}}" - + run: echo "The API key is:${{env.API_KEY}}" job2: runs-on: ubuntu-latest steps: - name: step 1 ## Another way reference your environment variables - run: echo "The API key is:$API_KEY , The mysqluser: $mysqluser - mysqlhost: $mysqlhost - mysqlpassword: $mysqlpassword - postgresuser: $postgresuser - postgreshost: $postgreshost - postgrespassword: $postgrespassword" \ No newline at end of file + run: echo "The API key is:$API_KEY" \ No newline at end of file From a8a00d19ac660186d0403bb985371a2a172c7e3d Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:10:35 +0300 Subject: [PATCH 15/24] playing around the tutorial --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e158e7..56d4ccc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: [pull_request, push] env: ## Sets environment variable - API_KEY: XXXXXXXXXXXX + API_KEY: Farfoura jobs: job1: From ae2f6768e877fe201a4f3790c5d471ea4ea81982 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:17:13 +0300 Subject: [PATCH 16/24] now on one of our variables --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56d4ccc..79e72f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: [pull_request, push] env: ## Sets environment variable - API_KEY: Farfoura + MYSQL_USER: fareeda jobs: job1: @@ -15,11 +15,11 @@ jobs: steps: - name: step 1 ## Reference your environment variables - run: echo "The API key is:${{env.API_KEY}}" + run: echo "The MySQL user is:${{env.MYSQL_USER}}" job2: runs-on: ubuntu-latest steps: - name: step 1 ## Another way reference your environment variables - run: echo "The API key is:$API_KEY" \ No newline at end of file + run: echo "The MySQL user is:$MYSQL_USER" \ No newline at end of file From 50a4dbbdf399c72cf279f57ade94fab16bc90406 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:24:07 +0300 Subject: [PATCH 17/24] two var --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79e72f4..8af0220 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,8 @@ on: [pull_request, push] env: ## Sets environment variable - MYSQL_USER: fareeda + MYSQL_USER: fareeda + MYSQL_HOST: static-65.155.180.199.ops.subrigo.net jobs: job1: @@ -15,11 +16,11 @@ jobs: steps: - name: step 1 ## Reference your environment variables - run: echo "The MySQL user is:${{env.MYSQL_USER}}" + run: echo "The MySQL user is:${{env.MYSQL_USER}} and The MySQL host is:${{env.MYSQL_HOST}}" job2: runs-on: ubuntu-latest steps: - name: step 1 ## Another way reference your environment variables - run: echo "The MySQL user is:$MYSQL_USER" \ No newline at end of file + run: echo "The MySQL user is:$MYSQL_USER and The MySQL host is:$MYSQL_HOST" \ No newline at end of file From e7e09bd542c98bdc7d1213d1107bcd0c97e01612 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:34:03 +0300 Subject: [PATCH 18/24] Adding all our variables following M. Ali tutorial --- .github/workflows/main.yml | 13 ++++++++++--- test/runtests.jl | 5 +++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8af0220..64c7202 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,14 @@ on: [pull_request, push] env: ## Sets environment variable MYSQL_USER: fareeda - MYSQL_HOST: static-65.155.180.199.ops.subrigo.net + MYSQL_HOST: localhost + MYSQL_PASSWORD: GSoCPass + MYSQL_PORT:3306 + POSTGRES_USER : postgres + POSTGRES_HOST : static-65.155.180.199.ops.subrigo.net + POSTGRES_PASSWORD: postgres3 + POSTGRES_PORT: 5432 + jobs: job1: @@ -16,11 +23,11 @@ jobs: steps: - name: step 1 ## Reference your environment variables - run: echo "The MySQL user is:${{env.MYSQL_USER}} and The MySQL host is:${{env.MYSQL_HOST}}" + run: echo "The MySQL user is:${{env.MYSQL_USER}} and The MySQL host is:${{env.MYSQL_HOST}} and The MySQL pass is:${{env.MYSQL_PASSWORD}} and ${{env.POSTGRES_HOST}} and ${{env.POSTGRES_PASSWORD}}" job2: runs-on: ubuntu-latest steps: - name: step 1 ## Another way reference your environment variables - run: echo "The MySQL user is:$MYSQL_USER and The MySQL host is:$MYSQL_HOST" \ No newline at end of file + run: echo "The MySQL user is:$MYSQL_USER and The MySQL host is:$MYSQL_HOST, $MYSQL_PASSWORD , $POSTGRES_PASSWORD , $POSTGRES_HOST" \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index c201d75..ed658bb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -10,7 +10,7 @@ using MySQL,SQLite, MySQL.API @test @isdefined conn end - + """ @testset "_dbconnect function for MySQL" begin conn = _dbconnect(MySQL.Connection, ENV['mysqlhost'], ENV['mysqluser'], ENV['mysqlpassword'], db="MySQL", port= 3306) @@ -26,4 +26,5 @@ end conn= _dbconnect(LibPQ.Connection, ENV['postgreshost'], ENV['postgresuser'], ENV['postgrespassword'], db = "mimic", port= 5432) @test @isdefined conn -end \ No newline at end of file +end +""" \ No newline at end of file From 6952fa6e8fc3f79d6f41b1977182f9e8d412f72f Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:36:47 +0300 Subject: [PATCH 19/24] ugh --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64c7202..fce03c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,9 +8,9 @@ env: MYSQL_USER: fareeda MYSQL_HOST: localhost MYSQL_PASSWORD: GSoCPass - MYSQL_PORT:3306 - POSTGRES_USER : postgres - POSTGRES_HOST : static-65.155.180.199.ops.subrigo.net + MYSQL_PORT: 3306 + POSTGRES_USER: postgres + POSTGRES_HOST: static-65.155.180.199.ops.subrigo.net POSTGRES_PASSWORD: postgres3 POSTGRES_PORT: 5432 @@ -23,7 +23,7 @@ jobs: steps: - name: step 1 ## Reference your environment variables - run: echo "The MySQL user is:${{env.MYSQL_USER}} and The MySQL host is:${{env.MYSQL_HOST}} and The MySQL pass is:${{env.MYSQL_PASSWORD}} and ${{env.POSTGRES_HOST}} and ${{env.POSTGRES_PASSWORD}}" + run: echo "The MySQL user is:${{env.MYSQL_USER}} and The MySQL host is:${{env.MYSQL_HOST}} and The MySQL pass is:${{env.MYSQL_PASSWORD}} and :${{env.POSTGRES_HOST}} and :${{env.POSTGRES_PASSWORD}}" job2: runs-on: ubuntu-latest From 13fcf78692da1fe0a83250e4842cf797b4683424 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Sun, 2 Jul 2023 23:43:06 +0300 Subject: [PATCH 20/24] following the tutorial --- .github/workflows/main.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fce03c6..de0ed8b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,23 +3,21 @@ name: env_tutorial ## pull request on the main branch on: [pull_request, push] -env: - ## Sets environment variable - MYSQL_USER: fareeda - MYSQL_HOST: localhost - MYSQL_PASSWORD: GSoCPass - MYSQL_PORT: 3306 - POSTGRES_USER: postgres - POSTGRES_HOST: static-65.155.180.199.ops.subrigo.net - POSTGRES_PASSWORD: postgres3 - POSTGRES_PORT: 5432 - - jobs: job1: ## The type of runner that the job will run on, ## here it runs on ubuntu latest runs-on: ubuntu-latest + env: + ## Sets environment variable + MYSQL_USER: fareeda + MYSQL_HOST: localhost + MYSQL_PASSWORD: GSoCPass + MYSQL_PORT: 3306 + POSTGRES_USER: postgres + POSTGRES_HOST: static-65.155.180.199.ops.subrigo.net + POSTGRES_PASSWORD: postgres3 + POSTGRES_PORT: 5432 steps: - name: step 1 ## Reference your environment variables From 2c3aa6d368e3f84955eb30fe6cc8a5c5a9bea849 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 00:10:23 +0300 Subject: [PATCH 21/24] here we go --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/main.yml | 26 ++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bd2bec..9587e11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,14 @@ jobs: ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" + - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: @@ -61,3 +68,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de0ed8b..27faa60 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,24 +8,26 @@ jobs: ## The type of runner that the job will run on, ## here it runs on ubuntu latest runs-on: ubuntu-latest - env: - ## Sets environment variable - MYSQL_USER: fareeda - MYSQL_HOST: localhost - MYSQL_PASSWORD: GSoCPass - MYSQL_PORT: 3306 - POSTGRES_USER: postgres - POSTGRES_HOST: static-65.155.180.199.ops.subrigo.net - POSTGRES_PASSWORD: postgres3 - POSTGRES_PORT: 5432 steps: - name: step 1 ## Reference your environment variables - run: echo "The MySQL user is:${{env.MYSQL_USER}} and The MySQL host is:${{env.MYSQL_HOST}} and The MySQL pass is:${{env.MYSQL_PASSWORD}} and :${{env.POSTGRES_HOST}} and :${{env.POSTGRES_PASSWORD}}" + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" job2: runs-on: ubuntu-latest steps: - name: step 1 ## Another way reference your environment variables - run: echo "The MySQL user is:$MYSQL_USER and The MySQL host is:$MYSQL_HOST, $MYSQL_PASSWORD , $POSTGRES_PASSWORD , $POSTGRES_HOST" \ No newline at end of file + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" From 5fdeff3e142cb44bb52b35af6475f8fbf8d46daa Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 00:13:24 +0300 Subject: [PATCH 22/24] without the secrets --- .github/workflows/ci.yml | 9 +-------- .github/workflows/main.yml | 33 --------------------------------- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9587e11..9a578a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,14 +46,7 @@ jobs: ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} - mysqlhost:${{secrets.MYSQL_HOST}} - mysqlpassword:${{secrets.MYSQL_PASSWORD}} - postgresuser:${{secrets.POSTGRES_USER}} - postgreshost:${{secrets.POSTGRES_HOST}} - postgresport:${{secrets.POSTGRES_PORT}} - postgrespassword:${{secrets.POSTGRES_PASSWORD}}" - + - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v1 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 27faa60..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: env_tutorial -## Triggers the workflow on when there is a push, or -## pull request on the main branch -on: [pull_request, push] - -jobs: - job1: - ## The type of runner that the job will run on, - ## here it runs on ubuntu latest - runs-on: ubuntu-latest - steps: - - name: step 1 - ## Reference your environment variables - run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} - mysqlhost:${{secrets.MYSQL_HOST}} - mysqlpassword:${{secrets.MYSQL_PASSWORD}} - postgresuser:${{secrets.POSTGRES_USER}} - postgreshost:${{secrets.POSTGRES_HOST}} - postgresport:${{secrets.POSTGRES_PORT}} - postgrespassword:${{secrets.POSTGRES_PASSWORD}}" - - job2: - runs-on: ubuntu-latest - steps: - - name: step 1 - ## Another way reference your environment variables - run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} - mysqlhost:${{secrets.MYSQL_HOST}} - mysqlpassword:${{secrets.MYSQL_PASSWORD}} - postgresuser:${{secrets.POSTGRES_USER}} - postgreshost:${{secrets.POSTGRES_HOST}} - postgresport:${{secrets.POSTGRES_PORT}} - postgrespassword:${{secrets.POSTGRES_PASSWORD}}" From bfc7ed207158444b541058857bc3489985c84b40 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 00:18:47 +0300 Subject: [PATCH 23/24] . --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7b6a5c4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +name: env_tutorial +## Triggers the workflow on when there is a push, or +## pull request on the main branch +on: [pull_request, push] +jobs: + job1: + ## The type of runner that the job will run on, + ## here it runs on ubuntu latest + runs-on: ubuntu-latest + steps: + - name: step 1 + ## Reference your environment variables + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" + job2: + runs-on: ubuntu-latest + steps: + - name: step 1 + ## Another way reference your environment variables + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" \ No newline at end of file From 6138c7aeaf5f64dce268e41b46182742ced60e69 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 00:50:46 +0300 Subject: [PATCH 24/24] After adding secrets to DBConnector --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ .github/workflows/main.yml | 31 ------------------------------- 2 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a578a1..f38aa2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,32 @@ jobs: - uses: codecov/codecov-action@v1 with: file: lcov.info + job1: + ## The type of runner that the job will run on, + ## here it runs on ubuntu latest + runs-on: ubuntu-latest + steps: + - name: step 1 + ## Reference your environment variables + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" + job2: + runs-on: ubuntu-latest + steps: + - name: step 1 + ## Another way reference your environment variables + run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} + mysqlhost:${{secrets.MYSQL_HOST}} + mysqlpassword:${{secrets.MYSQL_PASSWORD}} + postgresuser:${{secrets.POSTGRES_USER}} + postgreshost:${{secrets.POSTGRES_HOST}} + postgresport:${{secrets.POSTGRES_PORT}} + postgrespassword:${{secrets.POSTGRES_PASSWORD}}" docs: name: Documentation runs-on: ubuntu-latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 7b6a5c4..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: env_tutorial -## Triggers the workflow on when there is a push, or -## pull request on the main branch -on: [pull_request, push] -jobs: - job1: - ## The type of runner that the job will run on, - ## here it runs on ubuntu latest - runs-on: ubuntu-latest - steps: - - name: step 1 - ## Reference your environment variables - run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} - mysqlhost:${{secrets.MYSQL_HOST}} - mysqlpassword:${{secrets.MYSQL_PASSWORD}} - postgresuser:${{secrets.POSTGRES_USER}} - postgreshost:${{secrets.POSTGRES_HOST}} - postgresport:${{secrets.POSTGRES_PORT}} - postgrespassword:${{secrets.POSTGRES_PASSWORD}}" - job2: - runs-on: ubuntu-latest - steps: - - name: step 1 - ## Another way reference your environment variables - run: echo "The mysqlport is:${{secrets.MYSQL_PORT}}mysqluser:${{secrets.MYSQL_USER}} - mysqlhost:${{secrets.MYSQL_HOST}} - mysqlpassword:${{secrets.MYSQL_PASSWORD}} - postgresuser:${{secrets.POSTGRES_USER}} - postgreshost:${{secrets.POSTGRES_HOST}} - postgresport:${{secrets.POSTGRES_PORT}} - postgrespassword:${{secrets.POSTGRES_PASSWORD}}" \ No newline at end of file