Run Initial SQL on new connection?

  • 13 July 2020
  • 1 reply

Hey all –

I am wondering if there is a way to run a custom SQL statement for each connection . Specifically, I would like to inject the user name of the querier as a database variable, a la:

SET user_name TO '{{ looker_user_variable }}';

The reason for this is that the database I am connecting to enforces custom access control rules based on the user making the connection / query. These access control rules are defined in an external system (Immuta).

While I know that I can have end users enter their custom connection credentials and parameterize the connection using these (our current approach), I am looking for a way that allows me to bypass having users enter their passwords into their user profile. (Which I expect many people will not do.)

1 reply

Hi @Stephen_Bailey , did you get answer to this question?

Do we have any place in looker to Run the Initial query while connecting to the Database? Please help