This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes an external database connection.
Note: Once an external database connection is deleted, it can't be restored. To reconnect the database you need to create a new external database connection.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function deleteExternalDatabaseConnection(name: string): Promise<void>;
Name of the external database connection to delete.
import { externalDatabaseConnections } from "wix-data.v2";
import { elevate } from "wix-auth";
const elevatedDeleteExternalDbConnection = elevate(
externalDatabaseConnections.deleteExternalDatabaseConnection,
);
/*
* Sample name value: 'ConnectionOne'
*/
export async function myDeleteExternalDbConnection(name) {
try {
await elevatedDeleteExternalDbConnection(name);
return;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to void */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.