Overview
Salesforce is the world’s leading CRM platform. DBCode allows you to connect to your Salesforce org and:
- Browse objects: Explore standard and custom objects in your org
- Query data: Write and execute SOQL queries
- View relationships: See object relationships and field metadata
- Export data: Export query results to various formats
Prerequisites
Before connecting, you need to create a Connected App in Salesforce. This is a one-time setup that takes about 5 minutes.
Creating a Connected App
-
Log in to Salesforce and go to Setup (gear icon → Setup)
-
In the left sidebar, navigate to Platform Tools → Apps → External Client Apps
-
Click Settings and enable Allow creation of connected apps (if not already enabled)
-
Go back to External Client Apps and click New Connected App
-
Fill in the basic information:
- Connected App Name:
DBCode - API Name:
DBCode(auto-fills) - Contact Email: Your email address
- Connected App Name:
-
Under API (Enable OAuth Settings):
- Check Enable OAuth Settings
- Callback URL:
http://localhost:9876/callback - Selected OAuth Scopes: Add these scopes:
Manage user data via APIs (api)Perform requests at any time (refresh_token, offline_access)Access unique user identifiers (openid)
- Security settings (important):
- ✅ Keep Require Proof Key for Code Exchange (PKCE) enabled
- ❌ Uncheck Require Secret for Web Server Flow
- ❌ Uncheck Require Secret for Refresh Token Flow
-
Click Save
-
Wait 2-10 minutes for the Connected App to be provisioned
-
Go back to External Client Apps, find your app, and click to view it
-
Click Manage Consumer Details (you may need to verify your identity)
-
Copy the Consumer Key (this is your Client ID)
Connecting in DBCode
-
Open DBCode and click Add Connection
-
Select Salesforce as the database type
-
Configure the connection:
- Instance URL:
- Production:
https://login.salesforce.com - Sandbox:
https://test.salesforce.com - Custom domain:
https://yourdomain.my.salesforce.com
- Production:
- API Version:
59.0(or your preferred version)
- Instance URL:
-
For Authentication, click Create Auth Profile
-
In the auth profile form:
- Client ID: Paste the Consumer Key from your Connected App
- Other fields are pre-filled for Salesforce
-
Click Save - your browser will open for Salesforce login
-
Log in to Salesforce and authorize the app
-
Return to VS Code - you’re connected!
Querying Data
Salesforce uses SOQL (Salesforce Object Query Language), which is similar to SQL:
-- Query accountsSELECT Id, Name, Industry FROM Account LIMIT 10
-- Query with relationshipsSELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Technology'
-- Aggregate queriesSELECT COUNT(Id), Industry FROM Account GROUP BY IndustrySupported Features
| Feature | Support |
|---|---|
| Browse objects | Yes |
| SOQL queries | Yes |
| View field metadata | Yes |
| Export results | Yes |
| Insert/Update/Delete | Coming soon |
Troubleshooting
”Invalid Client ID” error
- Wait 2-10 minutes after creating the Connected App
- Verify you copied the Consumer Key correctly
”Callback URL mismatch” error
- Ensure the callback URL is exactly
http://localhost:9876/callback - Check for trailing slashes or typos
”Access Denied” error
- Your Salesforce user may not have API access
- Contact your Salesforce admin to enable API access for your profile
Resources
For more information about Salesforce, visit Salesforce.