Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Oct 9, 2025

Rationale for this change

Add connection attribute support for ODBC driver.

What changes are included in this PR?

  • Implementation of SQLGetConnectAttr and SQLSetConnectAttr to get and set connection attributes
  • Tests

Are these changes tested?

Will be tested in CI when PR is ready for review

Are there any user-facing changes?

No

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

⚠️ GitHub issue #47708 has been automatically assigned in GitHub to PR creator.

@alinaliBQ
Copy link
Contributor Author

@lidavidm @kou Please review this draft ODBC API PR, thanks. The testing folder structure will be in a separate PR

@github-actions github-actions bot added the awaiting review Awaiting review label Oct 9, 2025
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Oct 10, 2025

#ifdef SQL_ATTR_ASYNC_DBC_EVENT
TYPED_TEST(FlightSQLODBCTestBase, TestSQLSetConnectAttrAsyncDbcEventUnsupported) {
this->Connect();
Copy link
Member

Choose a reason for hiding this comment

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

SetUp() as David commented in other PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this->Connect() from tests. we will move it to SetUp

@kou
Copy link
Member

kou commented Oct 10, 2025

Could you create new draft PRs after you complete other draft PRs to reflect comments in other draft PRs?

@alinaliBQ
Copy link
Contributor Author

@lidavidm @kou Sure, will check the general comments first before creating new PRs. I will put the PRs to a pause for now since the comments are similar. Thanks for letting me know

Copy link
Contributor Author

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

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

In-progress of addressing comments. The team is still working on improving the subclass logic for separate test fixture (discussion is in #47788)


#ifdef SQL_ATTR_ASYNC_DBC_EVENT
TYPED_TEST(FlightSQLODBCTestBase, TestSQLSetConnectAttrAsyncDbcEventUnsupported) {
this->Connect();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this->Connect() from tests. we will move it to SetUp

@github-actions github-actions bot added awaiting review Awaiting review awaiting change review Awaiting change review awaiting committer review Awaiting committer review and removed awaiting changes Awaiting changes awaiting review Awaiting review awaiting change review Awaiting change review labels Oct 21, 2025
@alinaliBQ alinaliBQ force-pushed the gh-47708-sql-connect-attr branch from e8c404c to c6c5af9 Compare October 22, 2025 23:01
Copy link
Contributor Author

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

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

Rebased on top of master

@alinaliBQ alinaliBQ requested a review from lidavidm October 22, 2025 23:08
out_str_len /= arrow::flight::sql::odbc::GetSqlWCharSize();
std::string out_connection_string =
ODBC::SqlWcharToString(out_str, static_cast<SQLSMALLINT>(out_str_len));
EXPECT_TRUE(!out_connection_string.empty());
Copy link
Member

Choose a reason for hiding this comment

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

nit: EXPECT_FALSE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Oct 23, 2025
Copy link
Contributor Author

@alinaliBQ alinaliBQ 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 reviewing, please note that the tests in this PR requires connectivity support implementation (I will raise the PR for connectivity after #47760 is merged) in order to pass.

out_str_len /= arrow::flight::sql::odbc::GetSqlWCharSize();
std::string out_connection_string =
ODBC::SqlWcharToString(out_str, static_cast<SQLSMALLINT>(out_str_len));
EXPECT_TRUE(!out_connection_string.empty());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@alinaliBQ alinaliBQ force-pushed the gh-47708-sql-connect-attr branch from c6c5af9 to 2332bda Compare October 23, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants