My 2c on this : We are doing similar things at my current client - with less pain. I suspect you've been unlucky in your choice of libraries, and maybe expecting more than you get in clojure's ecosystem - ruby, python etc have been around a lot longer, and with a lot more focus on database use.
We use : * Liberator for REST - it's pretty great, though we had to add some custom exception handling * Compojure for routing, and static resources - the only middleware we had to write was for advanced json parsing * Flyway for migrations - there's a Clojure wrapper, but we had to customise it a fair bit. This uses raw sql migrations, but I *like* that. * Korma for sql, though our database was fairly simple, and we talked about moving to an alternative like honey sql - I'm not a big fan of Korma myself. * custom validation - we probably should have looked harder at existing libraries, but ended up rolling our own validation. - Korny On 4 Dec 2013 10:29, "James Laver" <james.la...@gmail.com> wrote: > Hi all, > > I'm fairly new to clojure (a few months), but not new to lisp or indeed > functional languages in general and I have around 10 years of experience > programming dynamic languages in general. > > I've recently been using luminus to build a RESTful web API and I've been > honestly surprised by how much code I've had to write to enable me to > actually get things done while using it. I can't say I was expecting > something full-stack like Django or Rails, but I wasn't expecting to have > to write quite so much code to get simple things done. I've now spent > around 14 hours building a RESTful web service that handles CRUD for a > single database table because I've had to solve so many things I've come up > against. > > What I'm actually wondering here is what I'm missing. Is it that the > entire clojurian approach is "here are the pieces, build a framework from > them" or is it just that I've had terrible luck with libraries? > > Some examples: > 1. The :params key is used by ring.middleware.params, compojure and > ring.middleware.format so it's impossible to know where a given param is > coming from > 2. ring.middleware.params does not provide a convenience map that merges > :query-params and :form-params, despite being happy to stuff everything > into :params. At least ring.middleware.format adds :body-params here. I've > now written a middleware to do this. > 3. ring.middleware.keyword-params only keywordises the :params map, not > the other maps. There is no configurable behaviour to ask it to do other > maps. I've now written a middleware for this > 4. migratus seems to have the smallest note ever in the documentation > informing you that version numbers must be 14 digits long (i was using 12 > digits for a timestamp by not having the seconds listed). This seems like a > really daft requirement in the first place. > 5. every migrations library i've seen that doesn't work off raw SQL files > is incapable of representing advanced features of my database of choice > (postgresql) > 6. lobos requires varchars to have a length limit applied (postgres does > not) > 7. the best way i've found of dealing with a database is korma. While > korma does reduce some of the pain of SQL for standard things, it has > limits and it doesn't save all that much pain. > > etc. > > So, am I missing something? Are there any libraries people can recommend > that will make my life easier? Am I just looking at this in completely the > wrong way? > > Thanks, > James > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.