3 ms·
Uh... ever heard of SQL? Here's the "code" you would send: select s.genre, sum(s.duration) as total_duration from listen_history h inner jo
by kingdomcome50 6y ago
Uh... ever heard of SQL? Here's the "code" you would send:
select s.genre,
sum(s.duration) as total_duration
from listen_history h
inner join songs s on s.song_id = h.song_id
where h.user_id = 12345
group by s.genre
- imhoguy 6y agoPlus ; DROP TABLE songs Sandboxing in environments with no trust is always a challenge. GP's idea was tried and failed many times thus we preffer data passing now.
- kingdomcome50 6y agoNo doubt. It is shame we are all forced to create own DSL (e.g. GET /genre/12345) that dispatches to the above though. I really had hopes for the OData specification, but it hasn't seemed to get much traction. It is worth noting, though, that many RDBMS allow for "read only" permission groups, so the risk of malicious DELETES/UPDATES isn't a huge problem in practice. Rather, it's the unbounded queries that could make your severs spin forever that truly represent the problem domain.
- miki123211 6y agoWhat about web browsers?
- CyberDildonics 6y agoI'm pretty sure web browsers are sandboxed and that it has taken a significant effort to get there.