Skip to content

Commit

Permalink
Allow additional ODBC driver options to be specified
Browse files Browse the repository at this point in the history
Enter in using form:

    OPTION=VALUE;OPTION2=VALUE2

Spaces are not recommended.
Trailing blank/spaces are NOT supported.
  • Loading branch information
clach04 committed May 15, 2020
1 parent b0fffef commit 4b3cc53
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions actian_odbc/connection-dialog.tcd
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
<has-pre-connect-database value="true" />
<has-schemas value="true" />
<port-prompt value="Port: " default="27832" /> <!-- 27832===VW FIXME port appears to be numeric ONLY mask in Tableau, defaulting to "VW" does work but then can not update to anything different -->

<vendor1-prompt value="Additional connection options:"/>

</connection-config>
</connection-dialog>
21 changes: 21 additions & 0 deletions actian_odbc/connectionBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
}
else
{
// TODO try using HostName and ListenAddress named params instead of single SERVER
// this would allow overrides - Tableau may not support this though :-(
params["SERVER"] = '@' + attr["server"] + ',' + attr["port"]; // NOTE implicit tcp_ip protocol
params["UID"] = attr["username"];
params["PWD"] = attr["password"];
Expand All @@ -22,6 +24,25 @@
params["DATABASE"] = params["DATABASE"].slice(0, slash_index); // strip class, leaving only database name
}


// support any ODBC connection attribute
// specify as OPTION=VALUE;OPTION2=VALUE2
var tmp_input = attr[connectionHelper.attributeVendor1].trim()
if (tmp_input)
{
// trim() maybe overkill, better safe than sorry
var tmp_list = tmp_input.split(';');
for (var key in tmp_list)
{
var tmp_str_pair = tmp_list[key].trim();
if (tmp_str_pair)
{
var key_value_list = tmp_str_pair.trim().split('=');
params[key_value_list[0].trim()] = key_value_list[1].trim();
}
}
}

var formattedParams = [];

formattedParams.push(connectionHelper.formatKeyValuePair(driverLocator.keywordDriver, driverLocator.locateDriver(attr)));
Expand Down
3 changes: 3 additions & 0 deletions actian_odbc/connectionResolver.tdr
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<attr>dbname</attr>
<attr>username</attr>
<attr>password</attr>

<attr> vendor1 </attr>

</attribute-list>
</required-attributes>
</connection-normalizer>
Expand Down

0 comments on commit 4b3cc53

Please sign in to comment.