malli 2025-05-16

What do you think, is it okay to use fn with side effects (lookup to db) inside malli scheme?

Lazy registries are designed for schemas that require side effects to initialize https://github.com/metosin/malli?tab=readme-ov-file#lazy-registries

๐Ÿ™ 1

Thank you, looks interesting

my first instinct would be to avoid that i think? I have been tempted to do something similar in the past for an enum (but the query would only happen once at startup), i think at that point though, a check like that probably belongs in business logic

๐Ÿ‘ 1
โž• 1

curious what you're using it for though

I was thinking to put email uniq verification on malli side

Past responses were: Put it in the business logic, not schema validation. Searching for โ€œunique emailโ€ I find this thread, perhaps itโ€™s helpful to you: https://clojurians.slack.com/archives/CLDK6MFMK/p1691330835332889

๐Ÿ™ 1

Thanks for sharing ๐Ÿ‘