Are there any projects or examples out there for nifty crux/Malli compat stuff. Schemas or crux helper functions etc
Good timing! See @ognivo 's new lib https://mobile.twitter.com/spacegangster/status/1388092289084428299
@danvingo is the initiator and the sponsor on this one π
Yeah so cool! I had a 5 min play with this yesterday! Great work!
Any further examples/projects anyone has seen? @taylor.jeremydavid
Nothing else that's hit my radar yet, but I'm also very interested by the intersection :) Semi-related: I am also curious about the possibility of Malli->Alloy tooling that could assist with modelling in Crux
Can connect in a bit and see what we come up with
@mail024 do you have any use-cases in mind you're looking for? or dev workflows? I have some of my own ideas for helper code I'd want related to crux, but I'm interested to hear of others.
@taylor.jeremydavid do you have any links or materials on alloy as it relates to crux?
Not yet. Just getting started integrating malli and crux (and new to both). Just wrote a transformer that santises crux entities to be passed on to a json api. transforms :crux.db/id -> id and strips out entity type im transacting in. Will get a better feel for what I need as I work with both
Malli coersion for crux database migration is going to be π
And UI generation
Mr Reiman, maybe you could be interested making a video review of the EQL generation I wrote and giving your opinion on a better way to write schema transformers? I think this could be beneficial for those writing transformers based on malli. If yes β we could schedule a video call @ikitommi If no β no worries.
sure @ognivo, would like to do that, just super busy at work atm, between projects. If the code - and the goal - is available somewhere, I could first try to read that, between things.
Yep, you can look at it here: https://github.com/dvingo/malli-code-gen/blob/main/src/malli_code_gen/gen_eql.clj We have a branch merge pending. If we merge it before you look at the code β weβll leave you a link in https://github.com/dvingo/malli-code-gen cc @ikitommi Not rushing you with the review. If you can say at what period you will be probably available for that (in a week or three) that would help. Good luck with the workload!
Hey @danvingo > do you have any links or materials on alloy as it relates toΒ crux? Nothing published from me yet, but this is worth a look https://www.hillelwayne.com/post/formally-modeling-migrations/ and, whilst not directly Alloy-related, I think principles of https://en.wikipedia.org/wiki/Object-role_modeling are also relevant
ooohh this looks great, thanks for sharing! I have some reading to do π
i'm mucking with jsonista/malli and would like to use keywords for some map values, eg: { :Nested { :Map { :enums "values" :other "string" }}} How do i get the values for :enums to be keywords, eg :values... yet leave other strings as strings?
@joel380 you need to describe a schema with all the parts that need transformations. in your case, simplest way to do it would be:
(require '[malli.provider :as mp]
'[malli.core :as m]
'[malli.transform :as mt])
;; infer schema from example value
(def schema (mp/provide [{:Nested {:Map {:enums :values}}}]))
;; create json-decoder for the schema
(def from-json (m/decoder schema (mt/json-transformer)))
;; apply
(from-json {:Nested {:Map {:enums "values" :other "string"}}})
; => {:Nested {:Map {:enums :values, :other "string"}}}