Skip to content

Commit d2033a5

Browse files
committed
remove duckdb from CI
1 parent c7c1f39 commit d2033a5

File tree

4 files changed

+5
-245
lines changed

4 files changed

+5
-245
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
db: ["hsqldb", "duckdb", "mysql", "postgresql", "oracle", "mssql"]
11+
db: ["hsqldb", "mysql", "postgresql", "oracle", "mssql"]
1212

1313
# if: "!contains(github.event.head_commit.message, 'skip ci')"
1414
runs-on: windows-latest

appveyor.yml

Lines changed: 0 additions & 167 deletions
This file was deleted.

script/generate_circleci.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ sudo ./posix-install.sh\n"}})
122122
;; graalvm isn't available in version 8 anymore for macOS
123123
:hsqldb-mac (assoc-in (mac)
124124
[:environment :POD_DB_TYPE] "hsqldb")
125-
:duckdb-linux (assoc-in (linux :static true)
125+
#_#_:duckdb-linux (assoc-in (linux :static true)
126126
[:environment :POD_DB_TYPE] "duckdb")
127-
:duckdb-linux-aarch64 (assoc-in (linux :arch "aarch64" :static true)
127+
#_#_:duckdb-linux-aarch64 (assoc-in (linux :arch "aarch64" :static true)
128128
[:environment :POD_DB_TYPE] "duckdb")
129-
:duckdb-mac (assoc-in (mac)
129+
#_#_:duckdb-mac (assoc-in (mac)
130130
[:environment :POD_DB_TYPE] "duckdb")
131131
:mysql-linux (assoc-in (linux :static true)
132132
[:environment :POD_DB_TYPE] "mysql")

test/pod/babashka/duckdb_test.clj

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,3 @@
11
(ns pod.babashka.duckdb-test
22
(:require [clojure.test :refer [deftest is testing]]
3-
[next.jdbc :as jdbc]
4-
[clojure.string :as str])
5-
(:import [org.duckdb DuckDBDriver]))
6-
7-
;; Registra o driver do DuckDB
8-
(DuckDBDriver.)
9-
10-
(defn duckdb-array->vec [arr]
11-
(when arr
12-
(into [] (str/split (str/replace (str arr) #"[\[\]]" "") #", "))))
13-
14-
(deftest duckdb-test
15-
(let [db-spec {:dbtype "duckdb"
16-
:dbname "test.duckdb"}]
17-
;; Clean up any existing database
18-
(try
19-
(jdbc/execute! db-spec ["drop table if exists foo;"])
20-
(catch Exception _))
21-
22-
(testing "basic operations"
23-
(is (jdbc/execute! db-spec ["create table foo (foo integer);"]))
24-
(is (thrown-with-msg? Exception #"already exists"
25-
(jdbc/execute! db-spec ["create table foo (foo integer);"])))
26-
(is (jdbc/execute! db-spec ["insert into foo values (1), (2), (3);"]))
27-
(let [query-result (jdbc/execute! db-spec ["select * from foo;"])]
28-
(is (= [{:foo 1} {:foo 2} {:foo 3}] query-result))))
29-
30-
(testing "connection"
31-
(with-open [conn (jdbc/get-connection db-spec)]
32-
(is (= [{:foo 1} {:foo 2} {:foo 3}]
33-
(jdbc/execute! conn ["select * from foo;"])))))
34-
35-
(testing "transaction"
36-
(jdbc/with-transaction [tx db-spec]
37-
(jdbc/execute! tx ["insert into foo values (4);"])
38-
(is (= [{:foo 1} {:foo 2} {:foo 3} {:foo 4}]
39-
(jdbc/execute! tx ["select * from foo;"]))))
40-
41-
(testing "rollback"
42-
(try
43-
(jdbc/with-transaction [tx db-spec]
44-
(jdbc/execute! tx ["insert into foo values (5);"])
45-
(throw (Exception. "rollback")))
46-
(catch Exception _))
47-
(is (= [{:foo 1} {:foo 2} {:foo 3} {:foo 4}]
48-
(jdbc/execute! db-spec ["select * from foo;"]))))
49-
50-
(testing "with-transaction"
51-
(jdbc/with-transaction [tx db-spec]
52-
(jdbc/execute! tx ["insert into foo values (5);"])
53-
(jdbc/execute! tx ["insert into foo values (6), (7);"]))
54-
55-
(is (= [{:foo 1} {:foo 2} {:foo 3} {:foo 4}
56-
{:foo 5} {:foo 6} {:foo 7}]
57-
(jdbc/execute! db-spec ["select * from foo;"])))))
58-
59-
(jdbc/execute! db-spec ["drop table foo;"]))
60-
61-
(testing "list support"
62-
(let [db-spec {:dbtype "duckdb"
63-
:dbname "test-list.duckdb"}]
64-
;; Clean up any existing database
65-
(try
66-
(jdbc/execute! db-spec ["drop table if exists foo;"])
67-
(catch Exception _))
68-
69-
(is (jdbc/execute! db-spec ["create table foo (foo integer[]);"]))
70-
(is (jdbc/execute! db-spec ["insert into foo select [1, 2, 3];"]))
71-
(let [result (jdbc/execute! db-spec ["select foo from foo"])
72-
result-vec (update-in result [0 :foo] duckdb-array->vec)]
73-
(is (= [{:foo ["1" "2" "3"]}] result-vec)))
74-
(let [result (jdbc/execute-one! db-spec ["select foo from foo"])
75-
result-vec (update result :foo duckdb-array->vec)]
76-
(is (= {:foo ["1" "2" "3"]} result-vec))))))
3+
[clojure.string :as str]))

0 commit comments

Comments
 (0)