diff --git a/go/adbc/driver/snowflake/snowflake_database.go b/go/adbc/driver/snowflake/snowflake_database.go index 7b76fa5a5a..76ab4684bf 100644 --- a/go/adbc/driver/snowflake/snowflake_database.go +++ b/go/adbc/driver/snowflake/snowflake_database.go @@ -176,6 +176,11 @@ func (d *databaseImpl) SetOptions(cnOptions map[string]string) error { } } + defaultAppName := "[ADBC][Go-" + infoDriverVersion + "]" + // set default application name to track + // unless user overrides it + d.cfg.Application = defaultAppName + var err error for k, v := range cnOptions { v := v // copy into loop scope @@ -265,6 +270,9 @@ func (d *databaseImpl) SetOptions(cnOptions map[string]string) error { } d.cfg.ClientTimeout = dur case OptionApplicationName: + if !strings.HasPrefix(v, "[ADBC]") { + v = defaultAppName + v + } d.cfg.Application = v case OptionSSLSkipVerify: switch v { diff --git a/python/adbc_driver_snowflake/adbc_driver_snowflake/__init__.py b/python/adbc_driver_snowflake/adbc_driver_snowflake/__init__.py index 701de23e3b..19b3bbc18e 100644 --- a/python/adbc_driver_snowflake/adbc_driver_snowflake/__init__.py +++ b/python/adbc_driver_snowflake/adbc_driver_snowflake/__init__.py @@ -131,6 +131,10 @@ def connect( kwargs = (db_kwargs or {}).copy() if uri is not None: kwargs["uri"] = uri + appname = kwargs.get(DatabaseOptions.APPLICATION_NAME.value, "") + kwargs[ + DatabaseOptions.APPLICATION_NAME.value + ] = f"[ADBC][Python-{__version__}]{appname}" return adbc_driver_manager.AdbcDatabase(driver=_driver_path(), **kwargs)