6 ms·
.sql files go into version control just as well as .java files. And because your build will be blowing all your stored procedures away and rebuilding them as p
by jasonkester 2y ago
.sql files go into version control just as well as .java files. And because your build will be blowing all your stored procedures away and rebuilding them as part of the build, you'll know at compile time if Junior Dev Jimmy dropped a null constraint or renamed something but didn't fix one of the procs.
That's way easier to debug than if Jimmy also had his query living as a string somewhere in your backend code.
Honestly, if this stuff is hard, it's because you've made it hard. I can only assume most people griping about stored procedures don't have a /sql folder living next to their /python or /java folder in source control.
- dalyons 2y agoOr… you just keep all your business logic in /java and call it a day. It’s stored procs that are making things harder.
- whizzter 2y agoKeeping SQL updates as part of the build does sound intriguing but does it work flexibly, not something for a live DB i hope (so when is it updated?) and assumes local copies for each DB. What build system has good integration for doing these kinds of updates out of the box or does it require customization?