dmigo commented on issue #2148: Impersonate database user when running queries
URL: 
https://github.com/apache/incubator-superset/issues/2148#issuecomment-326306953
 
 
   Would it be possible to personalize connection by changing 
[get_sqla_engine](https://github.com/apache/incubator-superset/blob/e53f3032bb2cc03019dec1b5eab49911801eab3a/superset/models/core.py#L590)
 to something like the following code snippet?
   
   ``` python
   def get_sqla_engine(self, schema=None, nullpool=False, username=None):
       extra = self.get_extra()
       uri = make_url(self.sqlalchemy_uri_decrypted)
       params = extra.get('engine_params', {})
       if nullpool:
           params['poolclass'] = NullPool
       uri = self.db_engine_spec.adjust_database_uri(uri, schema)
       
       # Inject user name into engine URL
       uri.username = username
   
       return create_engine(uri, **params)
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to