3 ms·
How frowned upon is it today to just do ``` const { accountId } = decodeJwt(req.headers.authorization) SELECT * FROM items WHERE account_id = :accountId ``` I
by MuffinFlavored 7y ago
How frowned upon is it today to just do
```
const { accountId } = decodeJwt(req.headers.authorization)
SELECT * FROM items WHERE account_id = :accountId
```
I get that it's about the exact opposite of what the article is trying to do but it looks a whole lot easier to maintain.
- tln 7y agoI wouldn't frown upon it, and would be surprised if the vast majority of apps didn't use app level segregation. At some level of complexity SQL gets hard to migrate, upgrade, switch vendors and even cloud providers
- wefarrell 7y agoThe article is solving a much more complicate use case where items can be read by a list of users and written to by another list of users.