Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Salesforce destination split out #2631

Merged
merged 7 commits into from
Dec 14, 2021
Merged

Conversation

pauloouriques
Copy link
Contributor

@pauloouriques pauloouriques commented Dec 2, 2021

Change description

This PR contains the most common usages of the Salesforce destination split out into separated destinations.

Checklists

Development

  • Application changes have been tested appropriately

Impact

  • Code follows company security practices and guidelines
  • Security impact of change has been considered
  • Performance impact of change has been considered
  • Possible migration needs considered (model migrations, config migrations, etc.)

Please explain any security, performance, migration, or other impacts if relevant:

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached where applicable.
  • Relevant tags have been added to the PR (bug, enhancement, internal, etc.)

@evantahler evantahler added plugin enhancement New feature or request labels Dec 7, 2021
Copy link
Member

@bleonard bleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I think there's some tactics to shred more code and make it more declarative as noted.

exportArrayProperties,
},
},
accountsDestinationConnection,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

plugins/@grouparoo/salesforce/src/lib/export/model.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,60 @@
import {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is almost exactly the same as the -contacts (and -objects?) one. That's true for many of these files.
I feel like there is an oppurtunity have a meta concept where you pass what's important (model defaults, known special fields to a single method (or maybe one each) and get back all the methods that implement the destination. TSo the desitnation-specific code would all be in connection.

See how app-templates buildConnection is used here:
https://github.com/grouparoo/grouparoo/blob/main/plugins/%40grouparoo/postgres/src/lib/table-import/connection.ts

export function getConnection() {
  return buildConnection({
    apps: ["postgres"],
    name: "postgres-import-table",
    displayName: "Postgres Table Import",
    description: "Import or update Records from a Postgres database table.",
    tableOptionDescription: "The table to scan",
    getSampleRows,
    getColumns,
    getTables,
    getChangedRows,
    getPropertyValue,
    getPropertyValues,
    getChangedRowCount,
  });
}

Copy link
Member

@bleonard bleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@pauloouriques pauloouriques merged commit b26b9bc into main Dec 14, 2021
@pauloouriques pauloouriques deleted the feature/salesforce-split-out branch December 14, 2021 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants