Created
December 12, 2013 15:31
-
-
Save kmtr/7929809 to your computer and use it in GitHub Desktop.
insert a file object to blob
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns beaconlog.db | |
| (:use clojure.core) | |
| (:require [clojure.java.jdbc :as j])) | |
| (defn insert-file [file] | |
| (j/db-transaction [db db-spec] | |
| (let [buffer (byte-array (.length file))] | |
| (j/insert! db :blob_table {:binary buffer})))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment