Fork me on GitHub
#luminus
<
2017-08-30
>
shakdwipeea15:08:19

I am having trouble setting up a new project using the luminus template with mysql. I am trying to do lein new luminus proj +mysql, after that I created a database in mysql and updated the profiles.clj accordingly. Now when I run migrations, I get ERROR migratus.database - Error creating DB connection for <mysql://localhost:3306/dbname?user=root&password=> java.lang.IllegalArgumentException: Vector arg to map conj must be a pair

shakdwipeea15:08:09

I have installed mysql through xampp on ubuntu.

shakdwipeea15:08:13

I have been trying to fix it for a long time and I don't know where to look next.

shakdwipeea15:08:17

Any directions would be a lot of help..

gdeer8116:08:59

is it because password is blank?

shakdwipeea16:08:09

My mysql password is blank

shakdwipeea16:08:20

i.e. no password

gdeer8116:08:05

do you get the same error if you leave off the "password=" part?

shakdwipeea16:08:46

Oh it worked..

gdeer8116:08:37

to explain the specific error message though, (conj {} [:user root :password]) or (conj {} [:user root] [:password]) will throw this error. these are valid vectors but when you're conjing onto a map they need to be tuples

gdeer8116:08:12

like (conj {} [:user root] [:password root])

gdeer8116:08:57

I think the latest version of clojure.java.jdbc uses spec to give better error messages I'll have to look at it later

gdeer8116:08:21

nope, the latest version of clojure.java.jdbc still gives you the same error message with that connection string

gdeer8116:08:39

@yogthos this seems like an easy mistake to make, do we want to catch this in migratus or should I take this discussion to the clojure.java.jdbc project?

yogthos16:08:34

I think it wouldn't hurt for migratus to handle this, but probably also worth noting it with clojure.java.jdbc since better errors will help everybody 🙂

gdeer8117:08:33

I opened up a ticket for this at 12:11 CST and it got resolved at 12:19 so migratus just has to bump the clojure.java.jdbc version to 7.1 which should be on out later today

yogthos01:08:29

perfect, probably would be good to update hugsql as well

yogthos01:08:47

and just released new version of migratus and luminus with the latest clojure.java.jdbc

gdeer8102:08:36

yes, thanks for your hard work maintaining all of this

Drew Verlee17:08:35

xposting from hugsql. Any advice on how to get a pgArray and contents into a clojure datastructure? https://github.com/DrTom/clj-pg-types doesnt seem to support later versions of clojure. Im using the jdbc driver.