Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created November 14, 2011 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcromartie/a518bece0b38b23ab226 to your computer and use it in GitHub Desktop.
Save jcromartie/a518bece0b38b23ab226 to your computer and use it in GitHub Desktop.
Korma FAIL
(ns anyclj.data
(require [clojure.java.jdbc :as sql])
(require [clojure.set :as set])
(use (korma db core)))
(def qa-spec
{:classname "com.microsoft.sqlserver.jdbc.SQLServerDriver"
:subprotocol "sqlserver"
:user "username"
:password "password"
:subname "//db-host"
:databaseName "database-name"})
(defdb qa qa-spec)
(defentity users
(pk :employeeid)
(table :tblEmployees))
;; this fails: (select users)
;;
;; Failure to execute query with SQL:
;; SELECT * FROM tblEmployees :: []
;; SQLServerException:
;; Message: Invalid object name 'tblEmployees'.
;; SQLState: S0002
;; Error Code: 208
;; this works: (sql/with-connection qa-spec (sql/with-query-results res ["SELECT * FROM tblEmployees"] ... ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment