3 ms·
One thing I like about SQL constraints is that they're so much shorter than in a procedural language. Has anyone developed an elegant system for bubbling them
by combatentropy 9y ago
One thing I like about SQL constraints is that they're so much shorter than in a procedural language.
Has anyone developed an elegant system for bubbling them up to the user interface? It seems you either have to write the same constraints again in JavaScript or build some massive list that maps ugly database errors to friendly user errors.
- mdpopescu 9y agoC# MVC has an attempt at creating some validation and automagically promoting that to the UI but it's (of course) limited to stuff like "this field is numeric" or "this field is required". Anything more complex needs duplication. I would assume that something like node.js or meteor have it easier, since they're using the same language in both layers; I believe there are also attempts at tools that automatically translate other languages to JS but I haven't used any of them.