UNPKG

3.22 kBMarkdownView Raw
1Heroku Connect CLI Plugin
2==================
3
4# Install
5
6 $ heroku plugins:install heroku-connect-plugin
7
8
9# Help
10
11 heroku help connect
12
13# Commands
14
15 heroku connect:db:set - Set database parameters
16 heroku connect:diagnose - Display diagnostic information about a connection
17 heroku connect:export - Export a mapping configuration JSON file
18 heroku connect:import FILE - Import a mapping configuration JSON file
19 heroku connect:info - Display connection information
20 heroku connect:mapping:state MAPPING - Return the state of a mapping
21 heroku connect:mapping:delete MAPPING - Delete an existing mapping
22 heroku connect:mapping:reload MAPPING - Reload a mapping's data from Salesforce
23 heroku connect:pause - Pause a connection
24 heroku connect:resume - Resume a connection
25 heroku connect:restart - Restart a connection
26 heroku connect:sf:auth - Authenticate a connection to Salesforce
27 heroku connect:state - Return the state flag for a single connection
28
29# Examples
30
31Download an existing mapping configuration
32
33 $ heroku connect:export
34 Saved config-file: app-name-resource-name.json
35
36# Tutorial
37
38Make sure you have a Heroku app, with a Postgres database attached
39
40## Add the Heroku Connect add-on to your app
41
42 $ heroku addons:create herokuconnect
43
44## Link the new connection (the Heroku Connect add-on instance) to your Heroku user
45
46 $ heroku connect:info
47
48## Now link the connection to the database, specifying the config var and schema name
49
50 $ heroku connect:db:set --db=DATABASE_URL --schema=salesforce
51 settings database parameters... done
52 db_key: DATABASE_URL
53 schema_name: salesforce
54
55If either option is not supplied, this command will ask for a value.
56
57## Authorize the connection to access your Salesforce organization
58
59 $ heroku connect:sf:auth
60 Launching Salesforce for authorization. If your browser doesn't open, please copy the following URL to proceed:
61
62 https://login.salesforce.com/services/oauth2/authorize?…
63
64This will launch your browser for an interactive authorization session.
65
66## Verify that connection is now in 'IDLE' state
67
68 $ heroku connect:state
69 IDLE
70
71## Now restore the exported configuration
72
73This 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.
74
75 $ heroku connect:import app-name-resource-name.json
76 Upload complete
77
78If you need to delete a mapping after the configuration has been imported, you can use a separate command for that:
79
80 $ heroku connect:mapping:delete Contact
81
82## Connect to your database to see the data
83
84 $ heroku pg:psql
85 > select * from salesforce.contact;
86
87## Contributing
88
89Read the following:
90
91- [Developing CLI Plugins](https://devcenter.heroku.com/articles/developing-cli-plugins)
92- [Testing CLI Plugins](https://devcenter.heroku.com/articles/testing-cli-plugins)
93- [CLI Style Guide](https://devcenter.heroku.com/articles/cli-style-guide)