Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Add two catalog operations: list_catalogs and list_schemas #193

Merged
merged 1 commit into from Jul 8, 2016
Merged

Add two catalog operations: list_catalogs and list_schemas #193

merged 1 commit into from Jul 8, 2016

Conversation

mloskot
Copy link
Contributor

@mloskot mloskot commented Jul 7, 2016

Both functions query data source using ODBC API call SQLTable:

  • list_catalogs with `SQL_ALL_CATALOGS to get list of valid catalogs.
  • list_schemas with SQL_ALL_SCHEMAS to get list of valid schemas.

Important detail to note is that the current nanodbc::catalog look-up functions have not been tested
in the Identifier Arguments mode, so it is (implicitly) assumed the connection/statement attribute SQL_ATTR_METADATA_ID is SQL_FALSE.


There is number of quirks related to use of SQLTables, so it is worth to have a look at these pages to get better understanding:

@@ -1469,6 +1469,10 @@ class catalog
, const string_type& schema = string_type()
, const string_type& catalog = string_type());

std::list<string_type> list_catalogs();
Copy link
Owner

Choose a reason for hiding this comment

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

No docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I rushed too much. I will add some.

@lexicalunit
Copy link
Owner

Looks pretty straightforward, just have one comment about missing Doxygen documentation for the new methods. Otherwise 👍

Both functions query data source using ODBC API call SQLTable:
list_catalogs with SQL_ALL_CATALOGS to get list of valid catalogs.
list_schemas with SQL_ALL_SCHEMAS to get list of valid schemas.
@mloskot
Copy link
Contributor Author

mloskot commented Jul 8, 2016

Docs updated. Merging.

@mloskot mloskot merged commit 7cf3e56 into lexicalunit:master Jul 8, 2016
@mloskot mloskot deleted the ml/list-catalogs branch July 8, 2016 08:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants