Data Model
The CData Python Connector for Salesforce models Salesforce data as an easy-to-use SQL database. There are three parts to the data model: tables, views, and stored procedures. The data model of the connector is dynamic. This means that, when you connect using the connector, any changes you make in the Salesforce UI, such as adding a new table, adding new columns, or changing a column's data type, are automatically included in the connector schema.
Tables
The Tables section, which details standard SQL tables, and the Views section, which lists read-only SQL tables, contain samples of what you might have access to in your Salesforce account. The table definitions are dynamically retrieved; here, we show the sample table definitions that are included in the Salesforce.com development environment.
Common tables include:
| Table | Description |
| Account | Contains details about customer accounts, including business or individual information and related activities. |
| Contact | Holds details about individuals associated with accounts, tracking communication and relationships.x |
| Lead | Tracks potential customers or business opportunities before they are converted into accounts and contacts. |
| Opportunity | Tracks potential revenue-generating sales deals, managing the sales pipeline. |
| Case | Manages customer service and support cases, tracking issues, resolutions, and customer interactions. |
| User | Stores details about Salesforce users, including login credentials, profiles, and roles. |
| Task | Represents user tasks, such as follow-ups and reminders, that track activities within Salesforce. |
| Event | Stores scheduled meetings, appointments, and calendar events associated with users or records. |
| Campaign | Tracks marketing campaigns, including outreach activities and associated leads, contacts, and opportunities. |
| CampaignMember | Links leads and contacts to campaigns, tracking participation and response details. |
| OpportunityLineItem | Represents products or services associated with an opportunity, tracking pricing and quantities. |
| Pricebook2 | Stores price books that define different pricing structures for products and services. |
| Product2 | Stores product catalog information, including details about goods and services offered by a company. |
| CaseComment | Stores comments added by support agents or customers to case records. |
| Attachment | Stores file attachments related to various Salesforce records, such as accounts, opportunities, or cases. |
| Report | Stores metadata for reports, defining data queries and visualization settings. |
| RecordType | Defines different record types within an object, allowing for customized page layouts and processes. |
| Profile | Defines user profiles, specifying access permissions and security settings for different roles. |
| Dashboard | Stores metadata for Salesforce dashboards, which provide visual reports and key performance metrics. |
| FeedItem | Represents Chatter posts, including status updates, file shares, and record interactions. |
Stored Procedures
Stored Procedures are scripts that are invoked via SQL queries. They perform tasks beyond standard CRUD operations, and can be used to search, update, and modify information in Salesforce.Working with Polymorphic Fields
Polymorphic Fields explains how to work with related objects as different types of objects.