this is totally left field but ive been working with loads of hugsql based http APIs, is there anything nice out there for generating malli schemas from hugsql files? would be an absolute bomb for validation in endpoints
I was thinking about this when working with hugsql back in the day (Malli wasn't a thing yet, we used Prismatic Schema) and I think there was something in hugsql's internals that can tell you all named inputs, from there you should be able to generate some simple schemas
this would be so awesome. probably going to see if i can get my team to put something together that can be reused when working with hug
FWIW stuff like that made us move to HoneySQL, it's much easier to reason about your query inputs
and composing queries in general
maybe something like an importable namespace that also requires hug from which one can grab a function / macro that uses the hugsql situation to def the schemas
is it easier to interop with malli when using honey?
depends on what you mean by interop - since queries are represented as data you'll have an easier time validating inputs to your query builder, or what comes out of it e.g. validate that every query generated by all functions contains a tenant_id condition in :where clause, stuff like that
after having fiddled with hugsql and setting up migrations. you have me convinced @lukaszkorecki honey just feels more idiomatic, and its not really that far from standard sql.
happy to hear that, don’t get me wrong - I used HugSQL in anger and I do like it, but only for very specific use cases, HoneySQL just has better dev ergonomics and scales better with complexity
thats the thing. its the scaling that makes it so damn good. for a very trivial sql use case, hug is fine. but for most cases where one really wants to rely on the data model for creating a great user experience, one ends up wanting more. i think i will try to do my next project using hug and compare fully the experience of it