Disconnect
Closes and removes a PostgreSQL database connection.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The unique identifier of the connection to close.
Options
- None
Output
- None
How It Works
The Disconnect node closes and removes a PostgreSQL database connection using the provided connection ID. When executed, the node:
- Validates the provided connection ID
- Retrieves the connection object from the internal connections dictionary
- Closes the database connection
- Removes the connection from the internal connections dictionary
Requirements
- A valid PostgreSQL connection must be established
- The connection ID must be valid and correspond to an active connection
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Connection Id
- Connection Id not found in the connections dictionary
Usage Notes
- Connections should be properly closed when no longer needed to free up resources
- After disconnecting, the connection ID becomes invalid and cannot be used again
- All transactions associated with the connection should be committed or rolled back before disconnecting