target-salesforce
is a Singer target for Salesforce.
Build with the Meltano Target SDK.
about
stream-maps
schema-flattening
You must authenticate with OAuth (client_id
, client_secret
, and refresh_token
) or User/Pass (username
, password
, and security_token
).
Setting | Required | Default | Description |
---|---|---|---|
client_id | False | None | OAuth client_id |
client_secret | False | None | OAuth client_secret |
refresh_token | False | None | OAuth refresh_token |
username | False | None | User/password username |
password | False | None | User/password password |
security_token | False | None | User/password generated security token. Reset under your Account Settings |
domain | False | login | Your Salesforce instance domain. Use 'login' (default) or 'test' (sandbox), or Salesforce My domain. |
action | False | update | How to handle incomming records by default (insert/update/upsert/delete/hard_delete) |
allow_failures | False | False | Allows the target to continue persisting if a record fails to commit |
A full list of supported settings and capabilities for this target is available by running:
target-salesforce --about
- For Oauth, you must create a connected app. See details from the Salesforce documentation.
Failure to ensure the following may result in incosistent results.
- Incoming records must conform to your salesforce objects. Field Names (Case Sensitive) are validated by the target, but data types are not.
- Stream name should match the target Object (ex. Account).
- Insert records should not contain
Id
or any fields that are not createable. - Update records must contain
Id
or any fields that are not updateable. - Upsert records must contain
Id
and all fields must be createable and updateable. - Delete/hard_delete records should only contain
Id
Here's a possible workflow on how to best use this tap in an Operational Analytics use case.
- tap-salesforce -> target-[DB]
- Transform/enrich data with dbt resulting in a clean table/view that matches the format of the Salesforce object.
- tap-[DB] -> target-salesforce
- Consider using inline stream maps if you need to rename fields to match the SF Object
You can inspect the result of bulk API load jobs via the following URL: [DOMAIN].lightning.force.com/lightning/setup/AsyncApiJobStatus/home
pipx install poetry
poetry install
The following will insert an Account record from input_example.jsonl
into your Salesforce instance. In your config, set action=insert
.
target-salesforce --version
target-salesforce --help
cat input_example.jsonl | target-salesforce --config .secrets/config.json
Create tests within the target_salesforce/tests
subfolder and
then run:
poetry run pytest
You can also test the target-salesforce
CLI interface directly using poetry run
:
poetry run target-salesforce --help
Testing with Meltano
Your project comes with a custom meltano.yml
project file already created. Open the meltano.yml
and follow any "TODO" items listed in
the file.
Next, install Meltano (if you haven't already) and any needed plugins:
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd target-salesforce
meltano install
Now you can test and orchestrate using Meltano:
# Test invocation:
meltano invoke target-salesforce --version
# OR run a test `elt` pipeline with the Carbon Intensity sample tap:
meltano elt tap-carbon-intensity target-salesforce
See the dev guide for more instructions on how to use the Meltano SDK to develop your own Singer taps and targets.