4 ms·
Are there any policy-language-libraries-backed-by-sql like Polar but that aren't based on logic programming languages? I don't really want to learn logic progra
by eatonphil 5y ago
Are there any policy-language-libraries-backed-by-sql like Polar but that aren't based on logic programming languages? I don't really want to learn logic programming for this purpose nor do I want to require it on my coworkers.
I guess I'm just looking for a library + SQL shorthand that can easily interpolate request variables and session variables that gets declared in code where a route is declared. Just spitballing but something like `(blogs.id = $req.blogid).userid = $session.userid OR (users.id = $session.userid).isAdmin`.
This [0] is close but it doesn't have enough momentum to be well documented let alone usable as a library in every language you'd want (Go, C#, Python, Node.js, etc.).
Edit: Maybe OPA/Rego can in fact do this [1].
[0] https://github.com/mrumkovskis/tresql https://github.com/mrumkovskis/tresql
[1] https://blog.openpolicyagent.org/write-policy-in-opa-enforce-policy-in-sql-d9d24db93bf4 https://blog.openpolicyagent.org/write-policy-in-opa-enforce...
- nicoburns 5y agoWhat advantage would this have over a middleware that implements this logic as a lambda?
- evancordell 5y agoRego is a nice language to use (IMO), but also has roots in logic programming and is closer to datalog than SQL.