I have a DB table that uses the following schema:
CREATE TABLE users (id SERIAL PRIMARY KEY, username TEXT UNIQUE NOT NULL, password TEXT NOT NULL, email TEXT NOT NULL, admin BOOLEAN NOT NULL, active BOOLEAN NOT NULL, created DATE NOT NULL);
I use Korma, defining a users object
(defentity users (has-many tips))
And I'm trying to minify values using the following functions:
(defn make-user-vals [username pass email] "Creates an active, non-admin user" {:username username, :password (crypt/encrypt pass), :email email, :admin false, :active true, :created (java.util.Date.)}) (defn seed-users! [] (insert ent/users (values (users/make-user-vals "admin" "f00b4r" " foo@example.com "))))
(seed-users!) crashes with a message (not very informative for my eyes):
Failure to execute query with SQL: INSERT INTO users (username, password, email, admin, active, created) VALUES (?, ?, ?, FALSE, TRUE, ?) :: [admin $2a$10$AVdxz9HvYOyszhcXVrTVi.oBcbz9EZVfGZYNUI3iDMb0hj3igvpEy foo@example.com
Any idea why?
(if this helps, the database query works, so it doesn't look like a connection problem)
Thanks!