Is it possible to define SQL functions in row select permissions?
Something like this does not seem to work currently:
{"_and":[{"date":{"_gte":"current_date - 1"}},{"date":{"_lte":"current_date + 1"}}]}
Date is a column of type Date.
I would like to restrict the SELECT permission, to only allow rows having date between yesterday and tomorrow. Thanks.
@lukaspili You are right, currently this is not possible to do. We'll leave the issue here for discussion and we'll see how many reaction it generates 馃檪
Sure, thanks. In the meantime I was able to solve my requirement using views.
I have a use case when I need to do some checking on other tables based on user supplied data in a given mutation. I guess a SQL function would solve that so +1.
This would be a fantastic feature, and have had similar requirements myself. Created and closed #2944 as a duplicate.
+1 for this feature. Use case for me is limiting the number of possible rows inserted for a user based on a value in another table (e.g. limited number of records for given subscription tier).
I stumbled upon requiring something similar, quickly jumped to table views like @lukaspili recommended, they are often a good option!
@mike360 Exactly.
Most helpful comment
+1 for this feature. Use case for me is limiting the number of possible rows inserted for a user based on a value in another table (e.g. limited number of records for given subscription tier).