From 526ca4846cd70e2d0bbd7f2b048b587b58450d48 Mon Sep 17 00:00:00 2001 From: TheCedarPrince Date: Thu, 23 Feb 2023 15:53:56 -0500 Subject: [PATCH 01/23] 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/23] 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/23] 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/23] . --- 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/23] 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 120f262fdc00289d32fcd5791c3ee32f799375ef Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 00:55:52 +0300 Subject: [PATCH 06/23] with github secrets --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e978134..e61d288 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,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 From 031dc3c084070bb707b6cc3b8948aa62b5e24d95 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 00:59:18 +0300 Subject: [PATCH 07/23] back to original --- .github/workflows/ci.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e61d288..e978134 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,32 +50,6 @@ 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 From d5091eee21367c633044d2e9c0719ed74ce0ac22 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 02:59:38 +0300 Subject: [PATCH 08/23] . --- test/runtests.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 1b944cb..90781e8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,5 @@ -using Test, Example +using Test -@test hello("Julia") == "Hello, Julia" -@test domath(2.0) ≈ 7.0 @testset "_dbconnect function for SQLite" begin From fa480765eb160351c8ec739d6744c6a50e981555 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 03:15:24 +0300 Subject: [PATCH 09/23] updating the path --- test/data/{database.db => SQLite.db} | 0 test/runtests.jl | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename test/data/{database.db => SQLite.db} (100%) 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 90781e8..6b7ca70 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ using Test @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/database.db") + conn= _dbconnect(SQLite.DB, "DBConnector/DBConnector.jl/test/data/SQLite.db") @test @isdefined conn end From 2760adc5a20e275ff6c64308764f0bb4c0b68924 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 03:35:45 +0300 Subject: [PATCH 10/23] Added quering --- test/data/SQLite.db | Bin 0 -> 8192 bytes test/runtests.jl | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/data/SQLite.db b/test/data/SQLite.db index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4f7deb1a3a8ce5f975dd8692f8fac1ce66dab8be 100644 GIT binary patch literal 8192 zcmeI#J5B>J5C-6x%}P{}(;&13Xb?@1A{s8h1}u~ZA$VPog2E9FS&3asuovJcT!=GJ z(sBd5By>o$6#p-K#;@w@T-;2{#>*-^Rj!d!>Jc-Yi4ak;ow0p~V@g191=j=go2ZH}9x7QlIKQHUt6? zfB*y_009U<00Izz00bZafqyU1>!ftV!?2WbSl7>??yDrFLms=@OHq~0I_q*u``lj3 HMeqk-2pTcZ literal 0 HcmV?d00001 diff --git a/test/runtests.jl b/test/runtests.jl index 6b7ca70..b61266c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,9 +1,15 @@ -using Test +using Test, DataFrames @testset "_dbconnect function for SQLite" begin conn= _dbconnect(SQLite.DB, "DBConnector/DBConnector.jl/test/data/SQLite.db") @test @isdefined conn + DBInterface.execute(conn, "CREATE TABLE PERSON (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)") + DBInterface.execute(conn, "INSERT INTO PERSON (name, age) VALUES ('John Doe', 30), ('Jane Smith', 25), ('Bob Johnson', 40)") + output = DBInterface.execute(conn, "SELECT age FROM PERSON WHERE name = 'John Doe'") |> DataFrame + out = output[1,1] + expected_output = 30; + @test out == expected_output end From f6e27dbff3bcedf248d4310f0344f4280151f8a5 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 03:42:41 +0300 Subject: [PATCH 11/23] removing database in the test --- test/data/SQLite.db | Bin 8192 -> 0 bytes test/runtests.jl | 2 ++ 2 files changed, 2 insertions(+) delete mode 100644 test/data/SQLite.db diff --git a/test/data/SQLite.db b/test/data/SQLite.db deleted file mode 100644 index 4f7deb1a3a8ce5f975dd8692f8fac1ce66dab8be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeI#J5B>J5C-6x%}P{}(;&13Xb?@1A{s8h1}u~ZA$VPog2E9FS&3asuovJcT!=GJ z(sBd5By>o$6#p-K#;@w@T-;2{#>*-^Rj!d!>Jc-Yi4ak;ow0p~V@g191=j=go2ZH}9x7QlIKQHUt6? zfB*y_009U<00Izz00bZafqyU1>!ftV!?2WbSl7>??yDrFLms=@OHq~0I_q*u``lj3 HMeqk-2pTcZ diff --git a/test/runtests.jl b/test/runtests.jl index b61266c..6b18ae2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -11,5 +11,7 @@ using Test, DataFrames out = output[1,1] expected_output = 30; @test out == expected_output + db_path = "DBConnector/DBConnector.jl/test/data/SQLite.db" + rm(db_path) end From 535ff8b3fcffcc3ed1b9e0c00ec07144d4daac84 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 03:48:23 +0300 Subject: [PATCH 12/23] updates --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 6b18ae2..42c0838 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ using Test, DataFrames @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "DBConnector/DBConnector.jl/test/data/SQLite.db") + conn= _dbconnect(SQLite.DB, "DBConnector/DBConnector.jl/test/data/sqlite.db") @test @isdefined conn DBInterface.execute(conn, "CREATE TABLE PERSON (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)") DBInterface.execute(conn, "INSERT INTO PERSON (name, age) VALUES ('John Doe', 30), ('Jane Smith', 25), ('Bob Johnson', 40)") @@ -11,7 +11,7 @@ using Test, DataFrames out = output[1,1] expected_output = 30; @test out == expected_output - db_path = "DBConnector/DBConnector.jl/test/data/SQLite.db" + db_path = "DBConnector/DBConnector.jl/test/data/sqlite.db" rm(db_path) end From 0e92556f6efdfeb24b7455ff6e2d41ed38813503 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 03:57:26 +0300 Subject: [PATCH 13/23] Adding Dataframes and examples --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 42c0838..8ee8420 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ using Test, DataFrames @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "DBConnector/DBConnector.jl/test/data/sqlite.db") + conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/sqlite.db") @test @isdefined conn DBInterface.execute(conn, "CREATE TABLE PERSON (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)") DBInterface.execute(conn, "INSERT INTO PERSON (name, age) VALUES ('John Doe', 30), ('Jane Smith', 25), ('Bob Johnson', 40)") @@ -11,7 +11,7 @@ using Test, DataFrames out = output[1,1] expected_output = 30; @test out == expected_output - db_path = "DBConnector/DBConnector.jl/test/data/sqlite.db" + db_path = "DBConnector.jl/test/data/sqlite.db" rm(db_path) end From 766149ad182a2590d0879056e3b18c252ac1c547 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 04:03:51 +0300 Subject: [PATCH 14/23] . --- Project.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Project.toml b/Project.toml index e73cf82..a4d780c 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,8 @@ version = "1.0.0" [deps] DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Example = "7876af07-990d-54b4-ab0e-23690620f79a" JDBC = "6042db11-3c3d-5e84-8dba-9cbf74c9ba48" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" MySQL = "39abe10b-433b-5dbd-92d4-e302a9df00cd" From 43b80c507661a7646db86a4faf57a8bddefd9f5e Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 04:10:47 +0300 Subject: [PATCH 15/23] . --- docs/make.jl | 6 +++--- test/runtests.jl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index fd29b00..11e840f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,5 @@ -using Documenter, Example +#using Documenter, Example -makedocs(modules = [Example], sitename = "Example.jl") +#makedocs(modules = [Example], sitename = "Example.jl") -deploydocs(repo = "github.com/quinnj/Example.jl.git", push_preview = true) +#deploydocs(repo = "github.com/quinnj/Example.jl.git", push_preview = true) diff --git a/test/runtests.jl b/test/runtests.jl index 8ee8420..220802d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using Test, DataFrames +using Test, DataFrames, SQLite @testset "_dbconnect function for SQLite" begin From 6152c9d79eff21a6a2bfce735794da7cb4908482 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 04:25:12 +0300 Subject: [PATCH 16/23] allowing the test to access the function for the workflow --- src/sqlite.jl | 2 ++ test/runtests.jl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sqlite.jl b/src/sqlite.jl index db31dd4..08fce44 100644 --- a/src/sqlite.jl +++ b/src/sqlite.jl @@ -1,3 +1,5 @@ +export _dbconnect + function _dbconnect(connector::Type{SQLite.DB}, file_path::String) return connector(file_path) diff --git a/test/runtests.jl b/test/runtests.jl index 220802d..24ea55b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using Test, DataFrames, SQLite - +include("DBConnector.jl/src/sqlite.jl") @testset "_dbconnect function for SQLite" begin From 106173a763c9b4ad3e7e6595a3e6bb7cfb85af75 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 04:32:11 +0300 Subject: [PATCH 17/23] add / for absolute path :) --- src/sqlite.jl | 1 + test/runtests.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sqlite.jl b/src/sqlite.jl index 08fce44..5c6bbb1 100644 --- a/src/sqlite.jl +++ b/src/sqlite.jl @@ -1,3 +1,4 @@ +using SQLite export _dbconnect function _dbconnect(connector::Type{SQLite.DB}, file_path::String) diff --git a/test/runtests.jl b/test/runtests.jl index 24ea55b..2e10782 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using Test, DataFrames, SQLite -include("DBConnector.jl/src/sqlite.jl") +include("/DBConnector.jl/src/sqlite.jl") @testset "_dbconnect function for SQLite" begin From 967e798b6afb5f61c5f302d74d1fe76d97806388 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 04:39:42 +0300 Subject: [PATCH 18/23] . --- test/data/sqlite.db | Bin 0 -> 8192 bytes test/runtests.jl | 4 ---- 2 files changed, 4 deletions(-) create mode 100644 test/data/sqlite.db diff --git a/test/data/sqlite.db b/test/data/sqlite.db new file mode 100644 index 0000000000000000000000000000000000000000..7c5d231d4def11db5fbf090953dcfd7db332e677 GIT binary patch literal 8192 zcmeI#J5B>J5C-6x%}P{}(;&13Xb?@1A{s8h1}u~ZA$VPog2EAoEMnIZ>;*Uq7eX9? zD{uq6By>o$6#p-K#;@w@TwG1d#>-uJs$3(-)FWm(5h0>vGh_P>$C_@|ZEN>`C848- z_ilW}>XqU^AOHafKmY;|fB*y_009U<00I#BP2h&NcCw6Lwi~y6^mA>B%h|dnr$*;i zi_M2qE$cJsm$x#SS$(dJ%+2T`Hw&5Q#XxFTd9nK14#eI2pErl?-@K#VNPVi0*boRn z00Izz00bZa0SG_<0uX=z1pd81uanXN55rQ%VO2key04Oy_Id1TFGW>0tE|f@?Q(l9 IXTk4%0gtUQy8r+H literal 0 HcmV?d00001 diff --git a/test/runtests.jl b/test/runtests.jl index 2e10782..e0a750a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,13 +5,9 @@ include("/DBConnector.jl/src/sqlite.jl") conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/sqlite.db") @test @isdefined conn - DBInterface.execute(conn, "CREATE TABLE PERSON (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)") - DBInterface.execute(conn, "INSERT INTO PERSON (name, age) VALUES ('John Doe', 30), ('Jane Smith', 25), ('Bob Johnson', 40)") output = DBInterface.execute(conn, "SELECT age FROM PERSON WHERE name = 'John Doe'") |> DataFrame out = output[1,1] expected_output = 30; @test out == expected_output - db_path = "DBConnector.jl/test/data/sqlite.db" - rm(db_path) end From 421f10d384fc47458781ba94633ff0fc710d3371 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 04:41:35 +0300 Subject: [PATCH 19/23] . --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index e0a750a..9ac3fd1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ include("/DBConnector.jl/src/sqlite.jl") @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "DBConnector.jl/test/data/sqlite.db") + conn= _dbconnect(SQLite.DB, "/DBConnector.jl/test/data/sqlite.db") @test @isdefined conn output = DBInterface.execute(conn, "SELECT age FROM PERSON WHERE name = 'John Doe'") |> DataFrame out = output[1,1] From 5eadd8e4e056f1302d08d9dda0dc20d2fd1433cc Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 05:05:58 +0300 Subject: [PATCH 20/23] . --- src/sqlite.jl | 1 - test/runtests.jl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sqlite.jl b/src/sqlite.jl index 5c6bbb1..8295f37 100644 --- a/src/sqlite.jl +++ b/src/sqlite.jl @@ -1,5 +1,4 @@ using SQLite -export _dbconnect function _dbconnect(connector::Type{SQLite.DB}, file_path::String) diff --git a/test/runtests.jl b/test/runtests.jl index 9ac3fd1..153b2da 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using Test, DataFrames, SQLite -include("/DBConnector.jl/src/sqlite.jl") +include("DBConnector.jl/src/sqlite.jl") @testset "_dbconnect function for SQLite" begin From 2d1ed6cfcab1aec7e96b5a571dcd514114990fa7 Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 05:11:55 +0300 Subject: [PATCH 21/23] path problems --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 153b2da..9255311 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,5 @@ using Test, DataFrames, SQLite -include("DBConnector.jl/src/sqlite.jl") +include("../DBConnector.jl/src/sqlite.jl") @testset "_dbconnect function for SQLite" begin From fc02a02183b52e7c58957f02d233369c2c7e3fde Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 05:18:19 +0300 Subject: [PATCH 22/23] . --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 9255311..f512acb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,9 +1,9 @@ using Test, DataFrames, SQLite -include("../DBConnector.jl/src/sqlite.jl") +include("../src/sqlite.jl") @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "/DBConnector.jl/test/data/sqlite.db") + conn= _dbconnect(SQLite.DB, "/data/sqlite.db") @test @isdefined conn output = DBInterface.execute(conn, "SELECT age FROM PERSON WHERE name = 'John Doe'") |> DataFrame out = output[1,1] From fdef69c2f0b5c0e2dca4f15958e7248149e33e8f Mon Sep 17 00:00:00 2001 From: Farreeda Date: Mon, 3 Jul 2023 05:25:59 +0300 Subject: [PATCH 23/23] . --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index f512acb..71c52f9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ include("../src/sqlite.jl") @testset "_dbconnect function for SQLite" begin - conn= _dbconnect(SQLite.DB, "/data/sqlite.db") + conn= _dbconnect(SQLite.DB, "../test/data/sqlite.db") @test @isdefined conn output = DBInterface.execute(conn, "SELECT age FROM PERSON WHERE name = 'John Doe'") |> DataFrame out = output[1,1]