3 ms·
If you do not like pgsql syntax i get that, you can always use python or something but why would you say custom sql scripts are hard to maintain?
by ruslan_talpa 10y ago
If you do not like pgsql syntax i get that, you can always use python or something but why would you say custom sql scripts are hard to maintain?
- dwaltrip 10y agoIsn't it harder to create well designed abstractions for business logic in SQL compared to a full-fledged backend application server? I know SQL has stored procedures and the like, but is it correct that SQL is limited in how it can express domain logic, compared to languages that backend application servers are generally written in?
- ruslan_talpa 10y agoThe point i was making was more in the direction of logic in the database, not specifically in pure SQL, it can be PgSql, Python ... does not matter. For the tasks that database side code should be used for (data consistency/access rights/reports on data) i would say they can express the domain logic for those tasks quite nicely, even better then in other languages. For example i can say "grant select on invoices to accountant" or i can add a constraint on a table like "CHECK (price > discounted_price)" or "CHECK (price > 0)". I do that in one place and i no longer have to worry about checking this (simple example of) domain logic anywhere else. Most of the time this is what people call domain logic (consistency/access/reports) although i would think a better name for it would be "data logic", heard that somewhere and in a lot of the cases this is almost everything the application does
- masklinn 10y ago> I know SQL has stored procedures and the like, but is it correct that SQL is limited in how it can express domain logic, compared to languages that backend application servers are generally written in? Procedural extensions aren't, really. I mean you can literally just use Python (pg/python) or Javascript (plv8) to write postgres functions.