bake
03/08/2022, 5:09 PMgaryaustin
03/08/2022, 5:24 PMbake
03/08/2022, 8:10 PMgaryaustin
03/08/2022, 8:10 PMbake
03/08/2022, 8:10 PMgaryaustin
03/08/2022, 8:11 PMbake
03/08/2022, 8:13 PMexport const getServerSideProps: GetServerSideProps = async ({ req }) => {
const prisma = new PrismaClient();
const animals = await prisma.animals.findMany();
console.log("getting animals", animals);
return {
props: { animals: JSON.parse(JSON.stringify(animals)) },
};
};
garyaustin
03/08/2022, 8:16 PMbake
03/08/2022, 8:18 PMPrisma with Supabase RLS policies
For a recent task I had to set up Prisma to take into account RLS (Row Level Security) policies set up in Supabase. This, as you know, is difficult to achieve as by default Prisma opens a direct connection to the database, and that too with the postgres user that has permissions to bypass every RLS policy.
garyaustin
03/09/2022, 3:47 PMbake
03/10/2022, 3:12 PM