Salesforce
Treat a Salesforce org as a read-only database: discover its schema, run native SOQL queries, and let agents query it with AI
Overview
The Salesforce database connector reaches a Salesforce org over the REST API and exposes it as a read-only database: Squid discovers the org's objects as a schema, serves native SOQL queries, and gives agents a Salesforce DB ability for answering questions over the data with AI-generated SOQL.
This is a different connector type from the Salesforce SaaS connector, which manages CRM records (create, update, upsert, change feed). The database connector is read-only, and regular Squid collection queries and mutations are not supported; use native SOQL queries instead.
Creating a Salesforce Connected App
The connector authenticates with the OAuth 2.0 Client Credentials Flow, so every call runs as the connected app's run-as user:
- In Salesforce Setup, create a Connected App (or External Client App) with OAuth enabled and the Manage user data via APIs (
api) scope. - Enable the Client Credentials Flow and assign a run-as user. The connector reads with this user's permissions, so grant its profile or permission sets read access to the objects you plan to query.
- Copy the app's Consumer Key and Consumer Secret.
Adding the connector
- Navigate to the Connectors tab in the Squid Console, click Available Connectors, and select the Salesforce Database connector.
- Provide the configuration:
Connector ID: A string that uniquely identifies the connector in your code.
Domain: Your org's My Domain URL, including the protocol, such as https://mycompany.my.salesforce.com. Plain-HTTP domains are refused.
Consumer Key and Consumer Secret: From the Connected App. The secret is stored securely as a Squid secret.
API Version: Optional. The Salesforce REST API version to pin.
- Click Next and review the discovered schema. Discovery covers business objects (layoutable or custom objects, excluding custom settings,
__mdtmetadata types, and system companion objects such as Share, History, and Feed). Reference fields become associations keyed by SOQL relationship names, so AI-generated queries can traverse parent and child relationships.
Querying
Run SOQL with executeNativeSoqlQuery, binding values with ${name} placeholders; see Native Salesforce SOQL queries for the syntax and binding rules. In the Console, Query with AI on the connector's Schema tab writes SOQL from natural language, and agents connected to the database do the same.
Behavior to know:
- Results are fully paged, child subqueries included, and capped at 50,000 records per query.
- SOQL has no server-side bind variables, so parameters are escaped and inlined as literals. Placeholders inside string literals, nested or empty lists, and control characters are rejected.
- Secure access from clients with
@secureNativeQueryrules, whose context for this connector carries the SOQL text and parameters.