GoogleCloudPlatform/cloud-sql-python-connector

Improve user agent logic

jackwotherspoon opened this issue · 0 comments

User agent currently is set during the first connection call. Subsequent calls have no way of updating the custom user agent. Aka if you create a connector and use it with many drivers or many custom user agents only the ones used on the first connect will be set.

Instead we should keep a set() of user agents and add as we go and update the client.

self._client = CloudSQLClient(
self._sqladmin_api_endpoint,
self._quota_project,
self._credentials,
user_agent=self._user_agent,
driver=driver,