Dynamically adjusting connection based on user attributes

Hi!  I'm working on a project to move our looker workloads from SQL Server to Snowflake.  I'd like to be able to use our existing model file but dynamically change the connection between SQL/Snowflake based on user attributes that I set.  I want to do this because it means I can gradually shift users to the new backend (and I can avoid doing a hard cutover).

How can I accomplish this?  I've tried:

1. Using Liquid to alter the connection of the model, e.g.:

 

{% if _user_attributes['use_snowflake'] %}
connection: "snowflake"
{% else %}
connection: "sql_server"
{% endif %}

 

 That doesn't work since apparently Liquid can't be used there.  

2.  Altering the connection attributes based on user_attributes:

burns44_0-1712924656243.png

This doesn't work.  Although you can dynamically route users to different databases within (say) SQL Server using attributes, you can't point them to a connection with a different dialect.

Is this possible using Looker?

 

0 0 106
0 REPLIES 0
Top Labels in this Space
Top Solution Authors