Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adapt for new versions of clojure, clojureql & incanter

  • Loading branch information...
commit a9526865ced57333691c4074e3f51595043776e7 1 parent 5fe3359
@alexott alexott authored
View
11 modules/incanter-sql/project.clj
@@ -1,6 +1,7 @@
-(defproject incanter-sql "1.2.3"
+(defproject incanter-sql "1.4.1"
:description "Database interaction via ClojureQL"
- :dependencies [[incanter/incanter-core "1.2.3"]
- [org.clojure/clojure "1.2.1"]
- [clojureql "1.1.0-SNAPSHOT"]]
- :dev-dependencies [[org.apache.derby/derby "10.8.1.2"]])
+ :dependencies [[incanter/incanter-core "1.4.1"]
+ [clojureql "1.0.4"]
+ ]
+ :profiles {:dev {:dependencies [[org.apache.derby/derby "10.8.1.2"]]}}
+ )
View
13 modules/incanter-sql/src/incanter/sql.clj
@@ -1,10 +1,9 @@
-(ns
- ^ {:doc "SQL module for interacting with databases."}
- incanter.sql
- (:use
- [incanter.core :only [dataset]]
- clojure.contrib.sql
- [clojureql.core :as ql :exclude [conj! disj! distinct]]))
+(ns incanter.sql
+ "SQL module for interacting with databases."
+ (:use [incanter.core :only [dataset]]
+ [clojureql.core :as ql :exclude [conj! disj! take drop distinct case compile sort]])
+ (:require [clojure.java.jdbc :as jdbc])
+ )
(defn window [psize wsize]
(let [full-chunks (quot psize wsize)
View
13 modules/incanter-sql/test/incanter/sql_tests.clj
@@ -3,9 +3,10 @@
incanter.sql
incanter.core
clojure.core
- clojure.contrib.sql
+ [clojure.java.jdbc :exclude [resultset-seq]]
[clojureql.core :as q :exclude [conj! disj! take drop distinct case compile sort]]
- ))
+ )
+ )
;;HACK: Jack into the clojureql namespace to override the syntax of
;;the commands that are written.
@@ -192,7 +193,7 @@ verify the lazy fetching."
(let [dset (read-dataset (q/table :TAB1))]
(is (dataset? dset))
(is (= [:my_id] (:column-names dset)))
- (is (= 3 (:my_id (first (:rows dset))))))))
+ (is (= 3M (:my_id (first (:rows dset))))))))
(deftest test-db-data-types
(wrap-db-test
@@ -269,8 +270,8 @@ verify the lazy fetching."
(is (dataset? ret))
(let [retrows (:rows ret)]
;; Check the first row looks OK...
- (is (= 1 (:a (first retrows))))
- (is (= {:a 20 :b "X120"} (nth retrows 19)))
+ (is (== 1 (:a (first retrows))))
+ (is (= {:a 20M :b "X120"} (nth retrows 19)))
;; Confirm the query count:
;; It's not 2, because we wanted to get the population
@@ -278,7 +279,7 @@ verify the lazy fetching."
(is (= 3 (count @clojureql.core/statements-made)))
;; Now let's get something further out in the list
- (is (= {:a 65 :b "X165"} (nth retrows 64)))
+ (is (= {:a 65M :b "X165"} (nth retrows 64)))
;; And check again
(is (= 6 (count @clojureql.core/statements-made)))
Please sign in to comment.
Something went wrong with that request. Please try again.