Skip to content

Commit

Permalink
Merge pull request #20 from Bit-Quill/revert-19-add-github-workflow-p…
Browse files Browse the repository at this point in the history
…ack-bi-connectors-AOS-253

Revert "Add GitHub workflow to pack BI connectors"
  • Loading branch information
Yury-Fridlyand authored Dec 21, 2021
2 parents 741c963 + 3bb0941 commit 10d5061
Show file tree
Hide file tree
Showing 25 changed files with 597 additions and 60 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/bi-connectors.yml

This file was deleted.

12 changes: 6 additions & 6 deletions bi-connectors/PowerBIConnector/OpenSearch.pq
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OpenSearchType = type function (
])
)
as table meta [
Documentation.Name = "OpenSearch Project"
Documentation.Name = "OpenSearch"
];

OpenSearchImpl = (Server as text, Port as number, UseSSL as logical) as table =>
Expand Down Expand Up @@ -189,7 +189,7 @@ OpenSearch = [
in
{ "OpenSearch.Contents", Server, Port, UseSSL },

// Authentication modes.
// Authentication modes
Authentication = [
Implicit = [
Label = "NONE"
Expand All @@ -203,7 +203,7 @@ OpenSearch = [
]
],

// PBIDS Handler.
// PBIDS Handler
DSRHandlers = [
#"opensearch-sql" = [
GetDSR = (server, schema, object, optional options) => [ protocol = "opensearch-sql", address = [ server = server, port = schema, useSSL = object ] ],
Expand All @@ -216,7 +216,7 @@ OpenSearch = [
]
],

// Enable Encryption.
// Enable Encryption
SupportsEncryption = true,

Label = Extension.LoadString("DataSourceLabel")
Expand All @@ -241,15 +241,15 @@ OpenSearch.Icons = [
Icon32 = { Extension.Contents("OpenSearch32.png"), Extension.Contents("OpenSearch40.png"), Extension.Contents("OpenSearch48.png"), Extension.Contents("OpenSearch64.png") }
];

// Load common library functions.
// Load common library functions
Extension.LoadFunction = (name as text) =>
let
binary = Extension.Contents(name),
asText = Text.FromBinary(binary)
in
Expression.Evaluate(asText, #shared);

// Diagnostics module contains multiple functions.
// Diagnostics module contains multiple functions. .
Diagnostics = Extension.LoadFunction("Diagnostics.pqm");
Diagnostics.LogValue = if (EnableTraceOutput) then Diagnostics[LogValue] else (prefix, value) => value;

Expand Down
4 changes: 2 additions & 2 deletions bi-connectors/PowerBIConnector/resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
<value>Connect to OpenSearch</value>
</data>
<data name="ButtonTitle" xml:space="preserve">
<value>OpenSearch Project</value>
<value>OpenSearch</value>
</data>
<data name="DataSourceLabel" xml:space="preserve">
<value>OpenSearch Project</value>
<value>OpenSearch</value>
</data>
</root>
8 changes: 8 additions & 0 deletions bi-connectors/TableauConnector/opensearch_sql_odbc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## opensearch_sql_odbc

The connector files in `opensearch_sql_odbc` can be used to connect to OpenSearch server in Tableau.

* These connector files remove and modify a set of unsupported functions and operations.
* It includes set of capabilities to customize and tune connector behavior

To use this connector with Tableau, [Package the connector](https://tableau.github.io/connector-plugin-sdk/docs/package-sign) and [Run Packaged Connector (TACO file)](https://tableau.github.io/connector-plugin-sdk/docs/run-taco)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<connection-dialog class='opensearch_sql_odbc'>
<connection-config>
<authentication-mode value='ComboBoxIntegrated' />
<authentication-options>
<option name="None" value="NONE" default="true" />
<option name="Integrated" value="AWS_SIGV4" />
<option name="UsernameAndPassword" value="BASIC" />
</authentication-options>
<port-prompt value="Port: " default="9200" />
<show-ssl-checkbox value="true" />
<vendor1-prompt value="Region: " />
<vendor2-prompt value="Additional Options: " />
<has-databases value="false" />
<has-schemas value="false" />
</connection-config>
</connection-dialog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
(function dsbuilder(attr){
var params = {};

// Set host information in connection string
params["SERVER"] = attr[connectionHelper.attributeServer];
params["PORT"] = attr[connectionHelper.attributePort];

// Set authentication values in connection string
var authAttrValue = attr[connectionHelper.attributeAuthentication];
params["Auth"] = attr[connectionHelper.attributeAuthentication];
if (authAttrValue == "AWS_SIGV4"){
params["Region"] = attr[connectionHelper.attributeVendor1];
} else if (authAttrValue == "BASIC"){
params["UID"] = attr[connectionHelper.attributeUsername];
params["PWD"] = attr[connectionHelper.attributePassword];
}

// Set SSL value in connection string
if (attr[connectionHelper.attributeSSLMode] == "require"){
params["useSSL"] = "1";
} else {
params["useSSL"] = "0";
}

// Parse additional options and add in connection string
var odbcConnectStringExtrasMap = {};
const attributeODBCConnectStringExtras = "vendor2";
if (attributeODBCConnectStringExtras in attr){
odbcConnectStringExtrasMap = connectionHelper.ParseODBCConnectString(attr[attributeODBCConnectStringExtras]);
}
for (var key in odbcConnectStringExtrasMap){
params[key] = odbcConnectStringExtrasMap[key];
}

// Format the attributes as 'key=value'
var formattedParams = [];
formattedParams.push(connectionHelper.formatKeyValuePair(driverLocator.keywordDriver, driverLocator.locateDriver(attr)));
for (var key in params){
formattedParams.push(connectionHelper.formatKeyValuePair(key, params[key]));
}
return formattedParams;
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version='1.0' encoding='utf-8' ?>
<tdr class='opensearch_sql_odbc'>
<connection-resolver>
<connection-builder>
<script file='connectionBuilder.js'/>
</connection-builder>
<connection-normalizer>
<required-attributes>
<attribute-list>
<attr>server</attr>
<attr>port</attr>
<attr>authentication</attr>
<attr>username</attr>
<attr>password</attr>
<attr>sslmode</attr>
<attr>vendor1</attr>
<attr>vendor2</attr>
</attribute-list>
</required-attributes>
</connection-normalizer>
</connection-resolver>
<driver-resolver>
<driver-match >
<driver-name type='regex'>OpenSearch SQL ODBC*</driver-name>
</driver-match>
</driver-resolver>
</tdr>
Loading

0 comments on commit 10d5061

Please sign in to comment.