SHOW CONNECTIONS

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

Lists the connections that match an optionally supplied regular expression pattern. If no pattern is supplied then the command lists all the connections in the system.

Syntax

SHOW CONNECTIONS [ [ LIKE ] regex_pattern ]

You can also use SERVERS instead of CONNECTIONS.

Parameters

  • regex_pattern

    A regular expression pattern that is used to filter the results of the statement.

    • Except for * and | character, the pattern works like a regular expression.

    • * alone matches 0 or more characters and | is used to separate multiple different regular expressions, any of which can match.

    • The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.

Returns

A result set of cvonnections with the following columns:

  • name STRING NOT NULL: names of connections in the metastore.

  • connection_type STRING NOT NULL: The type of the connection. For example: postgresql.

  • created_at STRING NOT NULL: The timestamp when the connection was created, in ISO 8601 format.

  • created_by STRING NOT NULL: The principal who created the connection.

  • comment STRING: An optional user specified comment on a connection.

Examples

> SHOW CONNECTIONS;
 name                connection_type created_at                   created_by    comment
 ------------------- --------------- ---------------------------- ------------- ---------------------
 mysql_connection    mysql           2022-01-01T00:00:00.000+0000 alf@melmak.et mysql connection
 postgres_connection postgresql      2022-06-12T13:30:00.000+0000 alf@melmak.et postgresql connection

> SHOW CONNECTIONS LIKE 'mysql*';
 name             connection_type created_at                   created_by    comment
 ---------------- --------------- ---------------------------- ------------- ---------------------
 mysql_connection mysql           2022-01-01T00:00:00.000+0000 alf@melmak.et mysql connection