Connecting Pool (for Postgres transaction) with Auth Session from Clerk using Drizzle ORM
Hi team,
I have auth sessions setup with Clerk for neon-http so I'm able to leverage RLS policies, however, I'm having a hard time finding any documentation on including the auth session in a Pool Connection which is required for a transaction. Ie. I want to make sure the transaction enforces the RLS policies and has access to the current user session. With neon-http this is simple. db.$withAuth(authToken) solves all my problems, however, this is not clear how it would work in a Pool Connection or a transaction. Any help is much appreciated!
I have auth sessions setup with Clerk for neon-http so I'm able to leverage RLS policies, however, I'm having a hard time finding any documentation on including the auth session in a Pool Connection which is required for a transaction. Ie. I want to make sure the transaction enforces the RLS policies and has access to the current user session. With neon-http this is simple. db.$withAuth(authToken) solves all my problems, however, this is not clear how it would work in a Pool Connection or a transaction. Any help is much appreciated!
