2 ms·
How is this different from having a repository of queries somewhere - this is basically a query repository but not in the active language in fact. Your queries
by munk-a 6y ago
How is this different from having a repository of queries somewhere - this is basically a query repository but not in the active language in fact.
Your queries should be hidden away from the developer - I mean obfuscation is never the goal but separation is... If your query is written inline in some business logic that section of code has poor tests and is unreliable. SQL is complex, I absolutely adore it but it's not simple - keep it isolated from the logic of your system and, if possible, use a layered architecture approach that allows the entire persistence layer to be detachable.
- UncleEntity 6y ago> How is this different from having a repository of queries somewhere - this is basically a query repository but not in the active language in fact. Looks like they do fancy stuff like template substitution &etc instead of just opening a text file and feeding it to the sql engine. I was looking at it and thinking "why not just use jinga?" but then you wouldn't get the 'query manager' object and name spacing (and probably other features I've missed). It actually seems a fairly good way to mix languages, I haven't looked at the code to see what they're really up to but I like the concept.