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

Ignore UID and PWD options from Excel #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/connect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Connect {
return success_with_info;
}
// Ignore keys for use with Power Query
std::vector<std::string> PQIgnoreKeys = {"driver", "trusted_connection"};
std::vector<std::string> PQIgnoreKeys = {"driver", "trusted_connection", "uid", "pwd"};

private:
OdbcHandleDbc *dbc;
Expand Down
7 changes: 5 additions & 2 deletions test/tests/connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ void ConnectWithoutDSN(SQLHANDLE &env, SQLHANDLE &dbc) {

// Connect to a database with extra keywords provided by Power Query SDK
void ConnectWithPowerQuerySDK(SQLHANDLE &env, SQLHANDLE &dbc) {
std::string conn_str = "DRIVER={DuckDB Driver};database=" + GetTesterDirectory() +
+";custom_user_agent=powerbi/v0.0(DuckDB);Trusted_Connection=yes;";
std::string conn_str = "DRIVER={DuckDB Driver};database=" + GetTesterDirectory() + ";" +
"custom_user_agent=powerbi/v0.0(DuckDB);" + "Trusted_Connection=yes;" + "UID=user1;" +
"PWD=password1;" + "allow_unsigned_extensions=true;";
SQLCHAR str[1024];
SQLSMALLINT strl;

Expand All @@ -40,6 +41,8 @@ void ConnectWithPowerQuerySDK(SQLHANDLE &env, SQLHANDLE &dbc) {

EXECUTE_AND_CHECK("SQLDriverConnect", SQLDriverConnect, dbc, nullptr, ConvertToSQLCHAR(conn_str.c_str()), SQL_NTS,
str, sizeof(str), &strl, SQL_DRIVER_COMPLETE);

CheckConfig(dbc, "allow_unsigned_extensions", "true");
}

// Connect with incorrect params
Expand Down
Loading