项目作者: heroku

项目描述 :
CLI plugin for Heroku Connect (experimental)
高级语言: JavaScript
项目地址: git://github.com/heroku/heroku-connect-plugin.git
创建时间: 2015-04-28T17:40:42Z
项目社区:https://github.com/heroku/heroku-connect-plugin

开源协议:

下载


Heroku Connect CLI Plugin

Install

  1. $ heroku plugins:install @heroku-cli/heroku-connect-plugin
  2. Installing plugin @heroku-cli/heroku-connect-plugin... installed

Help

  1. $ heroku help connect

Commands

  1. heroku connect:db:set - Set database parameters
  2. heroku connect:diagnose - Display diagnostic information about a connection
  3. heroku connect:export - Export a mapping configuration JSON file
  4. heroku connect:import FILE - Import a mapping configuration JSON file
  5. heroku connect:info - Display connection information
  6. heroku connect:mapping:state MAPPING - Return the state of a mapping
  7. heroku connect:mapping:delete MAPPING - Delete an existing mapping
  8. heroku connect:mapping:reload MAPPING - Reload a mapping's data from Salesforce
  9. heroku connect:pause - Pause a connection
  10. heroku connect:resume - Resume a connection
  11. heroku connect:restart - Restart a connection
  12. heroku connect:sf:auth - Authenticate a connection to Salesforce
  13. heroku connect:state - Return the state flag for a single connection

Examples

Download an existing mapping configuration

  1. $ heroku connect:export
  2. Saved config-file: app-name-resource-name.json

Tutorial

Make sure you have a Heroku app, with a Postgres database attached

Add the Heroku Connect add-on to your app

  1. $ heroku addons:create herokuconnect
  1. $ heroku connect:info
  1. $ heroku connect:db:set --db=DATABASE_URL --schema=salesforce
  2. settings database parameters... done
  3. db_key: DATABASE_URL
  4. schema_name: salesforce

If either option is not supplied, this command will ask for a value.

Authorize the connection to access your Salesforce organization

  1. $ heroku connect:sf:auth
  2. Launching Salesforce for authorization. If your browser doesn't open, please copy the following URL to proceed:
  3. https://login.salesforce.com/services/oauth2/authorize?…
  4. This will launch your browser for an interactive authorization session.

Verify that connection is now in ‘IDLE’ state

  1. $ heroku connect:state
  2. IDLE

Now restore the exported configuration

This could be exported using the connect:export command or directly through the Heroku Connect dashboard. By editing this configuration file, you can add and edit existing mappings easily.

  1. $ heroku connect:import app-name-resource-name.json
  2. Upload complete

If you need to delete a mapping after the configuration has been imported, you can use a separate command for that:

  1. $ heroku connect:mapping:delete Contact

Connect to your database to see the data

  1. $ heroku pg:psql
  2. > select * from salesforce.contact;

Contributing

Read the following: