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

ODBC: SQLGetTypeInfo, SQLTables, and SQLColumns #2973

Merged
merged 11 commits into from
Jan 25, 2022

Conversation

tiagokepe
Copy link
Contributor

Hey all,

This PR implements the functions: SQLGetTypeInfo, SQLTables, and SQLColumns, according with the ODBC conformance core level.

Copy link
Collaborator

@Mytherin Mytherin 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 the PR! Looks good. Some comments:

bool first = true;
for (auto info_type : vec_types) {
query += "(";
if (first) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this first necessary or can we always output the casts?

#include <string>
#include <vector>

using std::string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please avoid using in headers

string OdbcUtils::GetQueryDuckdbColumns(const string &catalog_filter, const string &schema_filter,
const string &table_filter, const string &column_filter) {
string sql_duckdb_columns =
"SELECT "
Copy link
Collaborator

Choose a reason for hiding this comment

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

SQL statements can be made a lot more readable by using multi-line string literals, e.g.:

string sql_duckdb_columns = R"(
 SELECT NULL "TABLE_CAT",
                schema_name, ...
)";

@Mytherin Mytherin merged commit 9d07083 into duckdb:master Jan 25, 2022
@Mytherin
Copy link
Collaborator

Thanks for the updates! Looks great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants