ALTER CONNECTION

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 13.3 LTS and above check marked yes Unity Catalog only

Transfers the ownership of a connection to a new principal, renames a connection, or changes the connection options.

To set a comment on a connection use COMMENT ON CONNECTION.

Syntax

ALTER CONNECTION connection_name
 { [ SET ] OWNER TO principal |
   RENAME TO new_connection_name |
   OPTIONS ( option value [, ...] )

Parameters

  • connection_name

    The name of the connection to be altered.

  • [ SET ] OWNER TO principal

    Transfers ownership of the connection to principal.

  • RENAME TO new_connection_name

    Specifies a new name for the connection. The name must be unique within the Unity Catalog metastore.

  • OPTIONS

    Sets connection_type specific parameters needed to establish the connection.

    Replaces the existing list of options with a new list of options.

    • option

      The property key. The key can consist of one or more identifiers separated by a dot, or a STRING literal.

      Property keys must be unique and are case-sensitive.

    • value

      The value for the property. The value must be a BOOLEAN, STRING, INTEGER, or DECIMAL constant expression.

      For example a the value for password may be using the constant expression secret('secrets.r.us', 'postgresPassword') as opposed to entering the literal password.

Examples

> ALTER CONNECTION mysql_connection SET OWNER TO `alf@melmak.et`;

> ALTER CONNECTION mysql_connection RENAME TO `other_mysql_connection`;

> ALTER CONNECTION mysql_connection OPTIONS (host 'newmysqlhost.us-west-2.amazonaws.com', port '3306');