metarhia/metasql

Add Database.prototype.on('connect') event

alik-datsko opened this issue · 0 comments

It would be great if we could check pg_backend_pid before executing the query.
When pg closed an idle connection, it creates a new one along with the query. At this moment I would like to create a link pg_backend_pid => user_id (session variables or a table insert).
This is necessary for the organization of RLS at the database level.
I would be grateful if you enable this feature or suggest an worarround.