So, ideally, in my mind, based on a single schema definition, I should be able to fully generate complete Create Read Update Delete (CRUD) in a web-context, that is:
So ideally; i'd just define a schema for, say, a Person datatype with name and surname and address fields, and then call a macro or function like (defcrud Person my-person-schema)
and it works, i can go to a webpage, see the datatable, edit/delete data, and save the data all the way to the server.
My question is: is there anything in the clojure world that does something (or partially) as described above?
In my recent first full clj/cljs project, I found myself writing a lot of code for this basic stuff. In the olden days, when I used a GWT framework called SmartGWT, I just had to define a new ListGrid(myDataSource)
, and define a datasource (equivalent to the schema), and the rest was inferred (at least something with sensible defaults was).
The SmartGWT kind of high level of development is what enables true rapid prototyping for the kind of business apps I need to build quite often. GWT has its own drawbacks, like very slow compilation time for bigger apps, and the fact that I have to write Java, but it's the level of server-client integration out-of-the-box that I'm looking for in Clojure.
Disclaimer, I am the author of closp-crud.
First, thanks @mac for hinting to my library.
Second, what you are asking for is exactly what I want to achieve, but in a different way. I hate all the magic that happens when you do stuff like inferring code. So my approach is different in that all the code:
is generated and can be fully changed afterwards.
Of course this has other disadvantages, but I will happily take them.
That said, documentation is still lacking, I started an incentive with: http://closp.net last week and will keep on working on it.
I might as well add docs for closp-crud next, if you need so.
Apart from that I made an introductionary video two days ago: https://www.livecoding.tv/sveri/videos/wrnL1-clojure-closp-webframework-41 which shows the usage of closp and closp-crud in a very basic way.
Usage of closp-crud starts round about 12 minutes.
There is closp and closp-crud. That will take you part of the way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With