diff options
author | Ben Smith-Mannschott <bsmith.occs@gmail.com> | 2010-08-28 11:22:22 +0200 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2010-09-03 12:23:37 -0400 |
commit | fe4ed311166677cd571d23774171af1d830f7fc5 (patch) | |
tree | 70d6c519b8afa7bbee51bb8c3e243d4f3903b2e2 /modules/sql/src/main/clojure | |
parent | 034d3d1703d139117b38fe6a10f552e23aa48b5c (diff) |
remove deprecated clojure.contrib.string
Since clojure.contrib.string is used by other submodules, some changes
were required:
- gen-html-docs and prxml needed changes because of functions were
renamed or arguments reordered when promoted to clojure.string.
- jmx, json, miglayout, prxml and sql gained a private one-argument
implementation of as-str.
- repl-utils gained a private copy of c.c.string/partition, named
spartition.
- repl-utils replaced a call to c.c.string/substring? with a call to
the java String method '.contains' (with swapped argument order).
Signed-off-by: Stuart Sierra <mail@stuartsierra.com>
Diffstat (limited to 'modules/sql/src/main/clojure')
-rw-r--r-- | modules/sql/src/main/clojure/clojure/contrib/sql.clj | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/sql/src/main/clojure/clojure/contrib/sql.clj b/modules/sql/src/main/clojure/clojure/contrib/sql.clj index c6946078..5bc530af 100644 --- a/modules/sql/src/main/clojure/clojure/contrib/sql.clj +++ b/modules/sql/src/main/clojure/clojure/contrib/sql.clj @@ -21,9 +21,7 @@ :see-also [["http://github.com/richhickey/clojure-contrib/blob/master/src/test/clojure/clojure/contrib/test_sql.clj" "Example code"]]} clojure.contrib.sql - (:use (clojure.contrib - [def :only (defalias)] - [string :only (as-str)]) + (:use (clojure.contrib [def :only (defalias)]) clojure.contrib.sql.internal)) (defalias find-connection find-connection*) @@ -100,6 +98,12 @@ (transaction (seq (.executeBatch stmt))))) +(defn- as-str + [x] + (if (instance? clojure.lang.Named x) + (name x) + (str x))) + (defn create-table "Creates a table on the open database connection given a table name and specs. Each spec is either a column spec: a vector containing a column |