Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SQL DISCONNECT

Synopsis

SQL DISCONNECT alias

Description

Closes an external database connection identified by the given alias. After disconnecting, the alias is no longer valid and any subsequent SQL alias ... commands will fail.

Use SQL CONNECTIONS to see which connections are currently active before disconnecting.

Parameters

alias
The alias of the connection to close. Must match an active connection established with SQL CONNECT.

Examples

Disconnect a connection

SQL DISCONNECT source;

Full connection lifecycle

SQL CONNECT postgres 'postgres://user:pass@localhost:5432/mydb' AS source;
SQL source SHOW TABLES;
SQL source SELECT COUNT(*) FROM users;
SQL DISCONNECT source;

See Also

SQL CONNECT, SQL (query)