Repository navigation
First draft of New Connection Documentation - #331
Conversation
| The following are the instructions for adding a new data source | ||
|
|
||
| ## Add the following files for Creating a new Datasource | ||
|
|
There was a problem hiding this comment.
I'd format this as a list and perhaps have two sections: one for new files and another for updated files.
|
|
||
|
|
||
| ## Images | ||
| It is recommended to add the images as png and a good idea to include a regular and small icon |
There was a problem hiding this comment.
Add locations were logos are currently stored.
| function query(queryObject, connection); | ||
|
|
||
| //Question are these required? | ||
| function files(connection); |
There was a problem hiding this comment.
remove (normal connectors don't use this)
| function files(connection); | ||
|
|
||
| function storage(connection); | ||
| ``` |
There was a problem hiding this comment.
remove (normal connectors don't use this)
|
I'll give you more feedback after Jan, 3rd |
|
I cleaned up some instructions to broke it down into lists as suggested. A couple of points that I think would help myself and other developers.
|
|
Just a small update for the Settings.react.js file. I figured out there was an update that needed to be added to this file to make the query work correctly |
|
Could we update |
| # Detailed Implementation Instructions | ||
|
|
||
| ## Images | ||
| It is recommended to add the images as png and a good idea to include a regular and small icon. |
There was a problem hiding this comment.
We don't use the small icons any longer.
We only need an icon that looks good when displayed with max-width: 100px; and max-height: 70px;.
| 1. Add an entry in DIALECTS | ||
| 2. Add an entry in SQL_DIALECTS_USING_EDITOR | ||
| 3. Add an entry under CONNECTION_CONFIG | ||
| 4. Add the location of the logo in |
There was a problem hiding this comment.
- Add the location of the logo into LOGOS
| 3. Add an entry under CONNECTION_CONFIG | ||
| 4. Add the location of the logo in | ||
| 5. Add the preview query in the PREVIEW_QUERY section | ||
| 6. Add an entry in the SAMPLE_DBS |
There was a problem hiding this comment.
- Add sample credentials for your connector in the SAMPLE_DBS
| ## Updating the Tab.react.js | ||
| The following are the instructions for adding the Tab React JS file | ||
| 1. Add an entry for the connection label | ||
|
|
There was a problem hiding this comment.
Customise the label for your connector here:
let label;
if (dialect === DIALECTS.S3) {
label = `S3 - (${connectionObject.bucket})`;
} else if (dialect === DIALECTS.APACHE_DRILL) {
label = `Apache Drill (${connectionObject.host})`;
} else if (dialect === DIALECTS.APACHE_IMPALA) {
label = `Apache Impala (${connectionObject.host}:${connectionObject.port})`;
} else if (dialect === DIALECTS.APACHE_SPARK) {
label = `Apache Spark (${connectionObject.host}:${connectionObject.port})`;
} else if (connectionObject.dialect === DIALECTS.ELASTICSEARCH) {
label = `Elasticsearch (${connectionObject.host})`;
} else if (connectionObject.dialect === DIALECTS.SQLITE) {
label = connectionObject.storage;
} else {
label = `${connectionObject.database} (${connectionObject.username}@${connectionObject.host})`;
}| Currently there is Dialect types for SQL, ElasticSearch, S3 and Apache Drill. If | ||
| your new data source is an SQL Type you will need to add the new Dialect in the | ||
| fetchData section for SQL types. | ||
|
|
There was a problem hiding this comment.
I should clean up this file.
For the time being, I'd keep things simple and just ask the developer to update fetchData and add their connector dialect to the list in:
if (contains(connectionObject.dialect, [
DIALECTS.APACHE_IMPALA,
DIALECTS.APACHE_SPARK,
DIALECTS.IBM_DB2,
DIALECTS.MYSQL, DIALECTS.MARIADB, DIALECTS.POSTGRES,
DIALECTS.REDSHIFT, DIALECTS.MSSQL, DIALECTS.SQLITE,
DIALECTS.DATA_WORLD
])) {| * -row[1] column name | ||
| * -row[2] data type | ||
| * @param {Object} connection | ||
| * @return {Array} |
There was a problem hiding this comment.
* @returns {Promise} that resolves to { columnnames: [ 'tablename', 'column_name', 'data_type' ], rows: [[tablename1, columnname1, datatype1], ...]] }|
|
||
| /** | ||
| * The following function will connect to the datasource | ||
| * @param {Object} connection |
There was a problem hiding this comment.
* @returns {Promise} that resolves when the connection succeeds| * The following function will return a list of tables. | ||
| * The return result should an array of strings | ||
| * @param connection {object} | ||
| * @return {Array} |
There was a problem hiding this comment.
* @returns {Promise} that resolves to an array of table names| * The second is a two dimensional array which represents the rows to be displayed | ||
| * @param {string|object} queryObject | ||
| * @param {object} connection | ||
| * @return {object} -- tuple {columnames, rows} |
There was a problem hiding this comment.
* @returns {Promise} that resolves to { columnnames, rows }|
@shannonlal I've just noticed that you've started to implement the Athena connector. Shall we change the title of this PR to reflect the change? |
|
@n-riesco. Thanks for the comments I can look at these tonight. With regards to the renaming the pull request. You can leave this as is. For the Athena stuff. I have the backend working and just now have to integrate it into the frontend. I should have this ready to go in about a week |
|
@n-riesco. I noticed that the build is failing due to an issue with DB2 Unit Tests. I think you had mentioned that this was not related to my work. Is this till the case? Is there anything else you need from me for this pull request? The Athena stuff I will do on a separate pull request. |
|
@shannonlal For a documentation change, it's OK to ignore CircleCI. But if you want to get rid of the failure, the only thing you need to do is to rebase this PR against master. |
|
I'll have a look at this PR later today. |
| Builds are uploaded to https://github.com/plotly/falcon-sql-client/releases. | ||
|
|
||
| ## Troubleshooting | ||
| The Falcon Configuration information is installed in the users home directory. |
There was a problem hiding this comment.
the user's home directory.
|
|
||
| ## Troubleshooting | ||
| The Falcon Configuration information is installed in the users home directory. | ||
| For example Unix and Mac (~/.plotly/connector). If you have tried the install |
There was a problem hiding this comment.
For Windows %userprofile%\.plotly\connector\
| # Add New Data Source | ||
|
|
||
| ## Images | ||
| It is recommended to add the images as png and a good idea to include. |
There was a problem hiding this comment.
Icons
The connector must provide an icon to be displayed on the selection tab.
| ``` | ||
|
|
||
| ## Updating the constants.js file | ||
| The following are the instructions for adding the Constants File: |
| 6. Add sample credentials for your connector in the SAMPLE_DBS | ||
|
|
||
| ## Updating the Tab.react.js | ||
| The following are the instructions for adding the Tab React JS file |
|
|
||
| ## Updating the Settings.react.js | ||
| Update the fetchData function to make the calls to appropriate sessions.js backend. | ||
| Add your new connectino to the following list: |
|
@shannonlal I've made a few small comments after a quick read. I'll merge the PR after you address those. Again, thank you for writing this up! |
Merge remote-tracking branch 'upstream/master'
This is a first draft of the new Connection document as discussed in issue #266. I have tried to break down all the major steps that are required to create a new connection. I would welcome some comments and insight on how to make this document better. In addition, I have put some instructions on how to run the development environment as TBD. If someone can add some updated instructions that would be great.