dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 192 forks source link

mssql-cli does not offer to disable telemetry #525

Open posguy99 opened 2 years ago

posguy99 commented 2 years ago

As above. No one is OWED telemetry, it should be opt-in.

But to not inform on first run that telemetry is being sent? That's just wrong.

chrisg123 commented 2 years ago

incase anyone finds this useful:

from mssql-cli/mssqlcli/telemetry.py

def _user_agrees_to_telemetry(func):
    @wraps(func)
    def _wrapper(*args, **kwargs):
        user_opted_out = os.environ.get(MSSQL_CLI_TELEMETRY_OPT_OUT, False)
        if user_opted_out in ['True', 'true', '1']:
            return None
        return func(*args, **kwargs)

    return _wrapper