> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: listExternalDatabaseConnections(options: ListExternalDatabaseConnectionsOptions) # Method package: wixDataV2 # Method menu location: wixDataV2 --> externalDatabaseConnections --> listExternalDatabaseConnections # Method Link: https://dev.wix.com/docs/velo/apis/wix-data-v2/external-database-connections/list-external-database-connections.md # Method Description: Lists all of the site's external database connections of all adaptor types. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## List existing external database connections (dashboard page code) ```javascript import { externalDatabaseConnections } from "wix-data.v2"; import { elevate } from "wix-auth"; const elevatedListExternalDbConnections = elevate(externalDatabaseConnections.listExternalDatabaseConnections); export async function myListExternalDatabaseConnectionsFunction() { try { const listExternalDbConnectionsResponse = await elevatedListExternalDbConnections(); const firstConnectionName = listExternalDbConnectionsResponse.externalDatabaseConnections[0].name; const firstConnectionHaveCollections = listExternalDbConnectionsResponse.externalDatabaseConnections[0].connectionStatus.hasCollections; console.log('Here is a list of all current external database connections: ', listExternalDbConnectionsResponse.externalDatabaseConnections); return listExternalDbConnectionsResponse; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * [ * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "fkapmf9s-kf5z-lg04-mfia-kfo294pamvi5" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connection1", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "ukapguvn-kf5z-kfo4-kg94-nfoem4pamfi6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionFour", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "kf0pguvn-mgoi-kfo4-kg94-nfoefds5mfi6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionThree", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "fergfy84-kf5z-fdsf-kg94-nfoegfdg67i6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionTwo", * "protocolVersion": "V2", * }, * { * "applicationId": "8b7e9a62-t5hd-4372-gres-c6fb7762600b" * "connectionStatus": { * "successful": false, * "causeOfFailure": "DESTINATION_ENDPOINT_NOT_DEFINED", * "hasCollections": "UNKNOWN" * }, * "name": "extDbSpi", * "protocolVersion": "V3", * } * ] */ ``` ## List existing external database connections (export from backend code) ```javascript import { Permissions, webMethod } from "wix-web-module"; import { externalDatabaseConnections } from "wix-data.v2"; import { elevate } from "wix-auth"; const elevatedListExternalDbConnections = elevate(externalDatabaseConnections.listExternalDatabaseConnections); export const myListExternalDatabaseConnectionsFunction = webMethod( Permissions.Admin, async () => { try { const listExternalDbConnectionsResponse = await elevatedListExternalDbConnections(); const firstConnectionName = listExternalDbConnectionsResponse.externalDatabaseConnections[0].name; const firstConnectionHaveCollections = listExternalDbConnectionsResponse.externalDatabaseConnections[0].connectionStatus.hasCollections; console.log('Here is a list of all current external database connections: ', listExternalDbConnectionsResponse.externalDatabaseConnections); return listExternalDbConnectionsResponse; } catch (error) { console.error(error); // Handle the error } } ) /* Promise resolves to: * [ * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "fkapmf9s-kf5z-lg04-mfia-kfo294pamvi5" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connection1", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "ukapguvn-kf5z-kfo4-kg94-nfoem4pamfi6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionFour", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "kf0pguvn-mgoi-kfo4-kg94-nfoefds5mfi6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionThree", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "fergfy84-kf5z-fdsf-kg94-nfoegfdg67i6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionTwo", * "protocolVersion": "V2", * }, * { * "applicationId": "8b7e9a62-t5hd-4372-gres-c6fb7762600b" * "connectionStatus": { * "successful": false, * "causeOfFailure": "DESTINATION_ENDPOINT_NOT_DEFINED", * "hasCollections": "UNKNOWN" * }, * "name": "extDbSpi", * "protocolVersion": "V3", * } * ] */ ``` ## List existing external database connections with pagination ```javascript import { Permissions, webMethod } from "wix-web-module"; import { externalDatabaseConnections } from "wix-data.v2"; import { elevate } from "wix-auth"; const elevatedListExternalDbConnections = elevate(externalDatabaseConnections.listExternalDatabaseConnections); /* Sample options object: * * { * paging: { * limit: 3, * offset: 1 * } * } */ export const myListExternalDatabaseConnectionsFunctionOptions = webMethod( Permissions.Admin, async (options) => { try { const listExternalDbConnectionsResponse = await elevatedListExternalDbConnections(options); const firstConnectionName = listExternalDbConnectionsResponse.externalDatabaseConnections[0].name; const firstConnectionHaveCollections = listExternalDbConnectionsResponse.externalDatabaseConnections[0].connectionStatus.hasCollections; console.log('Here is a list of all current external database connections: ', listExternalDbConnectionsResponse.externalDatabaseConnections); return listExternalDbConnectionsResponse; } catch (error) { console.error(error); // Handle the error } } ) /* Promise resolves to: * { * "externalDatabaseConnections": [ * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "kvod85qz-fk40-mfi5-mfi4-mflqpmgl4f1" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionFour", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "lfoe8tfd-fl35-mfo4-mfd1-mvkf99bjfi30" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionThree", * "protocolVersion": "V2", * }, * { * "capabilities": { * "collectionModificationsSupported": false, * "fieldTypes": [] * } * "configuration": { * "secretKey": "fkapguvn-kf5z-kfo4-kg94-nfoem4pamfi6" * }, * "connectionStatus": { * "successful": true, * "causeOfFailure": "NONE", * "hasCollections": "YES" * }, * "endpoint": "https://example.com/my-external-database", * "name": "connectionTwo", * "protocolVersion": "V2", * } * ], * "pagingMetadata": { * "count": 3, * "offset": 1, * "total": 5, * "tooManyToCount": false * } * } */ ``` ---