-
-
Save jcromartie/a518bece0b38b23ab226 to your computer and use it in GitHub Desktop.
Korma FAIL
This file contains 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 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