This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-19
Channels
- # adventofcode (44)
- # announcements (2)
- # aws (9)
- # beginners (166)
- # braveandtrue (16)
- # calva (170)
- # cider (14)
- # cljdoc (9)
- # cljs-dev (4)
- # cljsrn (1)
- # clojars (1)
- # clojure (150)
- # clojure-dev (15)
- # clojure-europe (4)
- # clojure-india (3)
- # clojure-italy (93)
- # clojure-nl (18)
- # clojure-serbia (1)
- # clojure-spec (5)
- # clojure-uk (45)
- # clojurescript (54)
- # cursive (19)
- # data-science (8)
- # datomic (83)
- # emacs (6)
- # events (1)
- # hoplon (3)
- # hyperfiddle (3)
- # jobs (6)
- # jobs-discuss (1)
- # klipse (1)
- # lein-figwheel (6)
- # leiningen (15)
- # lumo (1)
- # nrepl (1)
- # pedestal (15)
- # re-frame (48)
- # reagent (4)
- # reitit (2)
- # remote-jobs (1)
- # rum (2)
- # shadow-cljs (111)
- # spacemacs (10)
- # sql (16)
- # testing (10)
- # tools-deps (5)
And if mocking around your code is too hard it's a clear and good sign of trouble. Either you are doing too many things in one place or the logic is too coupled. Good time to refactor. :)
to touch back on this — got to a great place. much easier to mock, and better separation of persistence and app concerns. Though I’ll admit the very thin added layer of indirection takes a second of squinting
@lockdown- Not in any system I've ever worked on, in 30+ years!
adding uniqueness constraints is putting business logic in the db
OK, I'll buy that. (uniqueness constraints)
I don't consider a "blob" of SQL you send over JDBC to be executed as "business logic in the db" tho'. I consider "business logic in the db" to be stored procedures (and, OK, uniqueness constraints).
But, yes, doing stuff in SQL from your app can sometimes be more performant than running several "simpler" queries and doing the "logic" in your code. I've also seen the opposite: when a complex query cannot be made more efficient and the DBA asks you to run multiple simple queries and perform that logic in your code 🙂
True, and occasionally that can be a real world concern (it hasn't been for us, when we've needed to lift complex SQL operations into concurrent Clojure code to improve performance). And of course there's also transactions -- for the occasions where you need coordination across multiple SQL statements (which is often a lot rarer than people seem to think -- see, for example, Gregor Hohpe's https://www.enterpriseintegrationpatterns.com/docs/IEEE_Software_Design_2PC.pdf )
thanks for the link, was just reading about how github doesn't like FKs https://github.com/github/gh-ost/issues/331#issuecomment-266027731
Yeah, our DBA was dead against FKs as well.