▲ | julik 2 days ago | |
I doubt I agree with this statement. If a junior is causing a full table scan by doing a where(), I will teach them how to detect it - and how to avoid doing this in the future. If the idea of how a joint does applications is that a junior should be able to work with the codebase without being able to generate a SQL query of arbitrary complexity - that is a valid desire, but let's not call it "a better architecture", let's call it "I want cheap labour from people I don't trust and don't want to teach". Maybe if the generation of those queries is from templates and it is the concern at hand - a better approach is using a restricted templating system like Liquid where all possible queries are canned and pre-generated via specific template helpers, but I doubt this mandates a Repository still. | ||
▲ | 0x457 2 days ago | parent [-] | |
> "I want cheap labour from people I don't trust and don't want to teach". Uhm...no? This is just about keeping things DRY. Do you pride yourself in writing an SQL query from scratch every time you need a query database? Abstracting `where()` and co away makes life easier for everyone to stay on the right path. |