Fork me on GitHub
#clojure-europe
<
2023-05-09
>
schmalz07:05:53

Morning all.

dharrigan08:05:02

Good Morning!

mccraigmccraig09:05:55

anyone know of a clj/s lib (or something from outside of the clj/s ecosystem but usable from clj/s) which models persistent entities and relationships ? i'm looking for something which maintains a repository of metadata about schema, keys and relationships, ideally with some notion of schema evolution - but not tied to a particular store... (confluent schema registry is reasonably close, but quite tied to confluent platform)

mccraigmccraig09:05:57

i've half-implemented something similar a couple of times and it makes a great foundation for a storage layer, but if someone else has done a better job i would be all over it

Daniel Craig13:05:09

You mean like a hibernate/ ORM?

mccraigmccraig13:05:03

not quite - i don't want any actual persistence - i just want modelling and ideally the sort of versioning help (strictures) that confluent schema gives you - e.g. preventing you modifying schema in a backwards incompatible way

mccraigmccraig14:05:08

so i suppose it's like part of hibernate - just the entity modelling part, without any of the actual persistence

mccraigmccraig14:05:29

e.g. this lib defines a simple model of collections ( https://github.com/yapsterapp/expo-collections/blob/trunk/src/yapster/collections/schema.cljs#L93 ), and uses it to create SQLite storage resources on mobile devices, and update those resources when collection models ( https://gist.github.com/mccraigmccraig/2a7c609048dc7d4d078f98937e9b528f ) change

mccraigmccraig14:05:50

but both hibernate and that last example are very tied to implementation... i think it's possible to do better

dominicm14:05:59

kinda like spec?

dominicm14:05:13

the original promise included backwards compat checking on the regex stuff

dominicm14:05:26

We’ve created something at work, but it’s not built-in

mccraigmccraig15:05:31

spec (or malli) is a good start... although less than i want - aside from backwards/forwards compatibility, other concepts i've found useful include keys and key-extractors ... that bag of concepts (schema, version-compatibility, keys, key-extractors) is just about enough to automatically manage storage resources, at least for document-oriented stores

mccraigmccraig15:05:06

the avro people have really thought hard about the compatibility thing : https://medium.com/codex/understanding-avro-compatibility-e2f9afa48dd1

Daniel Craig14:05:47

woah I didn't know you could run alloy inside of clojure

mccraigmccraig14:05:36

well that is certainly interesting @U09LZR36F... will have to think on it... i hadn't come across alloy before

mccraigmccraig16:05:03

i'm currently looking at converting some subset of malli to avro schema... looks like there is some prior clojure art ( https://www.youtube.com/watch?v=cRc0a4HJ7aI , https://github.com/dvingo/malli-code-gen/blob/malli-avro/src/dev/ivan_play2.clj ), and it would let me use the kafka schema registries and schema-based serde stuff

otfrom10:05:32

pretty happy with the colours on these flowers https://photos.app.goo.gl/n2HPNR1uFa6sQVaSA