enti
03/29/2022, 5:00 PMsql
CREATE POLICY "policy_companies_country_view"
ON companies_country_view
FOR SELECT USING (
// I want the id to be provided for SELECT to be allowed, i.e. 'WHERE id = xxx' required
// I dont want to allow the entire table to be seen, but only to allow a single line operation
);
Any idea ?Needle
03/29/2022, 5:00 PM/title
command!
We have solved your problem?
Click the button below to archive it.Avin
03/29/2022, 5:16 PMrpc
function to access one row at a time.Needle
03/29/2022, 5:16 PMenti
03/29/2022, 5:24 PMid
argument on the API call at this point. any way to do that?Avin
03/29/2022, 5:30 PMenti
03/29/2022, 5:36 PMAvin
03/29/2022, 5:36 PMAvin
03/29/2022, 5:37 PMAvin
03/29/2022, 5:37 PMenti
03/29/2022, 5:42 PMSELECT *
on a specific table and only allow SELECT * WHERE id = xx
. Whcih I guess I can contain with a SSR frontendAvin
03/29/2022, 5:43 PMAvin
03/29/2022, 5:46 PMusing (false)
2. Create a function to select one row,
CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$
SELECT * FROM foo WHERE fooid = $1;
$$ LANGUAGE SQL;
3. Call that function in the frontend using rpc
garyaustin
03/29/2022, 5:47 PMenti
03/29/2022, 5:57 PM