salesforce-dbsync
Python library to download data from Salesforce and synchronize with a relational database
Example
This example performs the following steps for Salesforce Object 'Account' when run for the first time:
- Downloads Table Metadata from Salesforce
- Downloads Table Data from Salesforce, limited to a maximum of 10000 rows
- Creates a MySQL Database if one does not already exist
- Creates Tables in MySQL alongwith Indexes if the Table does not already exist
- Uploads the data into the MySQL Table
In the subsequent runs, it performs the following steps:
- Downloads Table Data from Salesforce
- Refreshes data in MySQL with new records or updates that from Salesforce
- Note: Deletes in Salesforce are ignored
import sys
from screenwriter import Screenwriter
from salesforce_dbsync import Sync_Manager
def do_init ():
global sw, sync_mgr
sw = Screenwriter ()
db_creds = {'user':'mysql_uid', 'passwd':'mysql_pwd', 'db':'TESTDB'}
sf_creds = {'user':'sf_uid', 'passwd':'pb_pwd', 'token':'sf_tok'}
control_map = {'min-SystemModstamp-date':'2019-01-01', 'dml-limit':10000}
replace_map = {}
replace_map['UNWANTED-CHAR'] = ' '
control_map['char-replace-map'] = replace_map
sync_mgr = Sync_Manager (sw, db_creds, sf_creds, control_map)
def do_main ():
global sw, sync_mgr
sync_mgr.add_sync_profile ('Account', ['Name','BillingStreet','BillingCountry'], ["BillingCountry = 'Canada'"])
sync_mgr.init_mysql ()
sync_mgr.init_sfdc ()
sync_mgr.create_missing_db_tables ()
sync_mgr.sync ()
do_init ()
do_main ()
Metadata
Release files for salesforce-dbsync 1.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| salesforce-dbsync-1.4.4.tar.gz | 6.0 kB | Without provenance | Details for salesforce-dbsync-1.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| salesforce_dbsync-1.4.4-py3-none-any.whl | Python 3 | none | any | Details for salesforce_dbsync-1.4.4-py3-none-any.whl |
Total release size: 14.3 kB
Release files / salesforce-dbsync-1.4.4.tar.gz
| Download URL | salesforce-dbsync-1.4.4.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
271dbf60d8c57d41828b75e916ed26d961f5a72e1e85d2e1c9b6ca644f31f49d
|
|
BLAKE2b-256 checksum How to use checksums |
3a8c8a948dc2799015ebfbd24d2016678d25994b802f8882e88097f04389e10a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7
|
Release files / salesforce_dbsync-1.4.4-py3-none-any.whl
| Download URL | salesforce_dbsync-1.4.4-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4fdcf4c12c9d5fa5a3e82792b1a0fbc2cdfb93f36f82a04d7a2d6a3613c6087
|
|
BLAKE2b-256 checksum How to use checksums |
d4289471f2e9c162b1b8ee6849bca064a2abe13f34a2626a7571ad90b0f77cb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7
|
Security for salesforce-dbsync 1.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.