Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Salesforce JDBC Connector #2548

Closed
wants to merge 26 commits into from
Closed

Conversation

pgagnon
Copy link
Member

@pgagnon pgagnon commented Jan 18, 2020

Closes #1854

@cla-bot cla-bot bot added the cla-signed label Jan 18, 2020
@pgagnon pgagnon force-pushed the salesforce branch 2 times, most recently from 262c062 to 733cd8c Compare January 18, 2020 19:58
@pgagnon pgagnon changed the title Add Salesforce jdbc-based connector Add Salesforce JDBC Connector Jan 18, 2020
@pgagnon pgagnon force-pushed the salesforce branch 5 times, most recently from 0299090 to 7819474 Compare January 19, 2020 18:00
@pgagnon pgagnon marked this pull request as ready for review January 19, 2020 19:25
@pgagnon pgagnon force-pushed the salesforce branch 2 times, most recently from aff701e to 14e552f Compare February 7, 2020 17:12
@martint
Copy link
Member

martint commented Feb 19, 2020

@Praveen2112, can you help review this?

@Praveen2112
Copy link
Member

@martint Yes

Copy link
Member

@Praveen2112 Praveen2112 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this.

private static BlockWriteFunction multiPicklistWriteFunction(Type type)
{
return (statement, index, value) -> {
// Not implemented
Copy link
Member

Choose a reason for hiding this comment

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

Any reasons for not implementing it ? It would be iterating over that value and building a string ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Pure laziness at this point; the JDBC driver does not support writes yet.

metadataCache.put(this.partnerConnection.getConfig().getUsername(), this.metadata);
}

this.metadata.setConnection(this);
Copy link
Member

Choose a reason for hiding this comment

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

But it won't be thread safe right ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right.

Comment on lines +42 to +47
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
Copy link
Member

Choose a reason for hiding this comment

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

Are the artifacts in maven central? It's not a good idea to depend on third-party repositories. It makes the build more brittle and makes it hard for people that are using a maven proxy in their organizations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Let me check on that.

@@ -941,7 +941,6 @@ private static String escapeNamePattern(String name, String escape)
{
requireNonNull(name, "name is null");
requireNonNull(escape, "escape is null");
checkArgument(!escape.isEmpty(), "Escape string must not be empty");
Copy link
Member

Choose a reason for hiding this comment

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

Can we implement it as a separate commit

public SalesforceClient(BaseJdbcConfig baseConfig, SalesforceConfig salesforceConfig, ConnectionFactory connectionFactory)
{
super(baseConfig, "", connectionFactory);

Copy link
Member

Choose a reason for hiding this comment

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

This line can be removed

import java.util.List;
import java.util.stream.Collectors;

import static org.junit.Assert.assertEquals;
Copy link
Member

Choose a reason for hiding this comment

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

We can also use TestNG right ?

.to(SalesforceClient.class)
.in(Scopes.SINGLETON);

configBinder(binder).bindConfig(BaseJdbcConfig.class);
Copy link
Member

Choose a reason for hiding this comment

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

It would be binded in BaseJdbcModules so I guess we might not have to bind here

.in(Scopes.SINGLETON);

configBinder(binder).bindConfig(BaseJdbcConfig.class);
configBinder(binder).bindConfig(TypeHandlingJdbcConfig.class);
Copy link
Member

Choose a reason for hiding this comment

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

It would be binded in BaseJdbcModules so I guess we might not have to bind here

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ForceDriver
Copy link
Member

Choose a reason for hiding this comment

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

We can also add services file for this

throw new SQLFeatureNotSupportedException();
}

static {
Copy link
Member

Choose a reason for hiding this comment

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

We can move this static method up


import java.io.Serializable;

public class Column
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a builder for it ?

import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.joining;

public class SoqlQueryBuilder
Copy link
Member

Choose a reason for hiding this comment

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

We can extend QueryBuilder ?

{
}).in(Scopes.SINGLETON);

binder.requestStaticInjection(ForceConnection.class);
Copy link
Member

Choose a reason for hiding this comment

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

Where do we inject this ?

@kurtqq
Copy link

kurtqq commented Oct 12, 2021

wonder if there is any progress with the salesforce connector?
This could really make a diffrance

@kurtqq
Copy link

kurtqq commented Feb 14, 2022

Could this PR be completed?

@mosabua
Copy link
Member

mosabua commented Oct 12, 2022

Closing after discussion of @bitsondatadev with @pgagnon . If anyone wants to pick this up, feel free to take the code in this PR and adjust as necessary.

@mosabua mosabua closed this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add Salesforce connector
5 participants