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

  1. Log in to Salesforce and go to Setup (gear icon → Setup)

  2. In the left sidebar, navigate to Platform ToolsAppsExternal Client Apps

  3. Click Settings and enable Allow creation of connected apps (if not already enabled)

  4. Go back to External Client Apps and click New Connected App

  5. Fill in the basic information:

    • Connected App Name: DBCode
    • API Name: DBCode (auto-fills)
    • Contact Email: Your email address
  6. 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
  7. Click Save

  8. Wait 2-10 minutes for the Connected App to be provisioned

  9. Go back to External Client Apps, find your app, and click to view it

  10. Click Manage Consumer Details (you may need to verify your identity)

  11. Copy the Consumer Key (this is your Client ID)

Connecting in DBCode

  1. Open DBCode and click Add Connection

  2. Select Salesforce as the database type

  3. Configure the connection:

    • Instance URL:
      • Production: https://login.salesforce.com
      • Sandbox: https://test.salesforce.com
      • Custom domain: https://yourdomain.my.salesforce.com
    • API Version: 59.0 (or your preferred version)
  4. For Authentication, click Create Auth Profile

  5. In the auth profile form:

    • Client ID: Paste the Consumer Key from your Connected App
    • Other fields are pre-filled for Salesforce
  6. Click Save - your browser will open for Salesforce login

  7. Log in to Salesforce and authorize the app

  8. Return to VS Code - you’re connected!

Querying Data

Salesforce uses SOQL (Salesforce Object Query Language), which is similar to SQL:

-- Query accounts
SELECT Id, Name, Industry FROM Account LIMIT 10
-- Query with relationships
SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Technology'
-- Aggregate queries
SELECT COUNT(Id), Industry FROM Account GROUP BY Industry

Supported Features

FeatureSupport
Browse objectsYes
SOQL queriesYes
View field metadataYes
Export resultsYes
Insert/Update/DeleteComing 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.