Is there anything for general CRUD in clojure / clojurescript forms

So, ideally, in my opinion, based on one schema definition, I should completely generate the full Create Read Update Delete (CRUD) in the web context, i.e.:

  • client: an interactive component of the HTML data table for operations, possibly with built-in editing, etc.
  • client: form component for editing a single record, including validation, as deduced from the diagram
  • server: route to access data to populate and update the specified components (REST endpoint)
  • server: implementation for storing data, for example, in an SQL table.

So perfect; I would just define a schema for, say, a Person data type with first and last name and address fields, and then call a macro or function like (defcrud Person my-person-schema) and it works, I can go to the web page, see data, delete data and save data 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 that I wrote a lot of code for this core material. In the old days, when I used a GWT structure called SmartGWT , I just needed to define a new ListGrid(myDataSource) and define a data source (equivalent to a schema) and the rest was output (at least something with reasonable default values ​​was) .

The high level of development of SmartGWT is what allows me to quickly create prototypes for such business applications that I need to build quite often. GWT has its drawbacks, such as the very slow compilation time for larger applications, and the fact that I have to write Java, but this is the level of integration with the server and client that I am looking for in Clojure.

+7
clojure crud
source share
2 answers

Disclaimer, I am the author of closp-crud.

Firstly, thanks @mac for a hint at my library.

Secondly, what you ask for is exactly what I want to achieve, but in a different way. I hate all the magic that happens when you do something like code derivation. So my approach is different in that the whole code is:

  • html templates
  • routes
  • Migration
  • db access

generated and can be completely changed subsequently.
Of course, this has other drawbacks, but I will gladly take them.

However, the documentation is still missing, I began to stimulate: http://closp.net last week and will continue to work on it. <br> I could also add docs for closp-crud next if you need it.

I also made an introductory video two days ago: https://www.livecoding.tv/sveri/videos/wrnL1-clojure-closp-webframework-41 , which shows the use of closp and closp-crud in a very basic way.
Using a closed cake starts about 12 minutes.

+3
source share

There is closp and closp-crud , it will take you part of the way.

+3
source share

All Articles