|
Lightweight 0.20261105.1
|
#include "../../Api.hpp"#include "../../SqlBindingTypes.hpp"#include "../../SqlError.hpp"#include "../Concept.hpp"#include "Handles.hpp"#include "SqlOdbcPrelude.hpp"#include <expected>#include <string>#include <string_view>#include <sql.h>#include <sqlext.h>Go to the source code of this file.
Classes | |
| struct | Lightweight::Driver::Odbc::CatalogObjectName |
| The three-part name of a catalog object (a table, or a search pattern for tables), so that the parts are passed by name rather than as adjacent strings that could be swapped silently. More... | |
Functions | |
| LIGHTWEIGHT_API SqlResult | Lightweight::Driver::Odbc::OpenTablesCatalog (Statement const &stmt, CatalogObjectName const &tables, bool wideText) |
Opens the SQLTables result set of the tables of tables' catalog and schema, narrowed to its name search pattern. No table type is passed (null pointer, length 0). | |
| LIGHTWEIGHT_API SqlResult | Lightweight::Driver::Odbc::OpenColumnsCatalog (Statement const &stmt, CatalogObjectName const &table, bool wideText) |
Opens the SQLColumns result set of every column of table (no column name: null pointer, length 0). | |
| LIGHTWEIGHT_API SqlResult | Lightweight::Driver::Odbc::OpenPrimaryKeysCatalog (Statement const &stmt, CatalogObjectName const &table, bool wideText) |
Opens the SQLPrimaryKeys result set of table. | |
| LIGHTWEIGHT_API SqlResult | Lightweight::Driver::Odbc::OpenForeignKeysCatalog (Statement const &stmt, CatalogObjectName const &primaryKeyTable, CatalogObjectName const &foreignKeyTable, bool wideText) |
Opens the SQLForeignKeys result set of the foreign keys between the primary-key table and the foreign-key table; an empty table name leaves that side open. | |
| LIGHTWEIGHT_API SqlResult | Lightweight::Driver::Odbc::OpenStatisticsCatalog (Statement const &stmt, CatalogObjectName const &table, bool uniqueOnly, bool wideText) |
Opens the SQLStatistics result set of the indexes of table, with SQL_ENSURE. | |
| LIGHTWEIGHT_API std::expected< std::string, SqlErrorInfo > | Lightweight::Driver::Odbc::SearchPatternEscape (Connection const &connection) |
Reads the driver's SQL_SEARCH_PATTERN_ESCAPE string through the ANSI SQLGetInfo, into a 32-byte buffer. | |
| LIGHTWEIGHT_API SqlResult | Lightweight::Driver::Odbc::OpenCatalog (Statement const &stmt, SqlCatalogRequest const &request) |
Opens the catalog result set request names: calls OpenTablesCatalog, OpenColumnsCatalog, OpenPrimaryKeysCatalog, OpenForeignKeysCatalog or OpenStatisticsCatalog with its arguments. | |
The catalog operations of the ODBC driver: the ODBC catalog functions (SQLTables, SQLColumns, SQLPrimaryKeys, SQLForeignKeys, SQLStatistics) that SqlSchema runs to read a database's schema. Each opens the catalog result set on the statement and leaves it there; the caller reads it by column position, as the ODBC specification lays it out.
Every function is a thin wrapper: the same ODBC call with the same arguments as the code it was moved from, and the return code handed back as Lightweight::SqlResult so that the caller keeps its check at the same point. Text arguments go to the W entry point as UTF-16 when wideText is set, otherwise to the ANSI entry point with the UTF-8 bytes unchanged (see SqlConnection::AcceptsWideQueryText()). An empty text argument is passed as a null pointer with length 0.
Definition in file Catalog.hpp.
| LIGHTWEIGHT_API SqlResult Lightweight::Driver::Odbc::OpenTablesCatalog | ( | Statement const & | stmt, |
| CatalogObjectName const & | tables, | ||
| bool | wideText | ||
| ) |
Opens the SQLTables result set of the tables of tables' catalog and schema, narrowed to its name search pattern. No table type is passed (null pointer, length 0).
| stmt | The statement to open the result set on. |
| tables | The catalog name, the schema name and the table name search pattern (empty for all tables). |
| wideText | Whether to call SQLTablesW rather than SQLTables. |
SQLTables. OpenCatalog (see OpenCatalog below), which shared code calls with a Lightweight::Driver::SqlCatalogRequest. References Lightweight::Driver::Odbc::OpenTablesCatalog().
Referenced by Lightweight::Driver::Odbc::OpenTablesCatalog().
| LIGHTWEIGHT_API SqlResult Lightweight::Driver::Odbc::OpenColumnsCatalog | ( | Statement const & | stmt, |
| CatalogObjectName const & | table, | ||
| bool | wideText | ||
| ) |
Opens the SQLColumns result set of every column of table (no column name: null pointer, length 0).
| stmt | The statement to open the result set on. |
| table | The catalog name, the schema name and the table name. |
| wideText | Whether to call SQLColumnsW rather than SQLColumns. |
SQLColumns. OpenCatalog (see OpenCatalog below), which shared code calls with a Lightweight::Driver::SqlCatalogRequest. References Lightweight::Driver::Odbc::OpenColumnsCatalog().
Referenced by Lightweight::Driver::Odbc::OpenColumnsCatalog().
| LIGHTWEIGHT_API SqlResult Lightweight::Driver::Odbc::OpenPrimaryKeysCatalog | ( | Statement const & | stmt, |
| CatalogObjectName const & | table, | ||
| bool | wideText | ||
| ) |
Opens the SQLPrimaryKeys result set of table.
| stmt | The statement to open the result set on. |
| table | The catalog name, the schema name and the table name. |
| wideText | Whether to call SQLPrimaryKeysW rather than SQLPrimaryKeys. |
SQLPrimaryKeys. OpenCatalog (see OpenCatalog below), which shared code calls with a Lightweight::Driver::SqlCatalogRequest. References Lightweight::Driver::Odbc::OpenPrimaryKeysCatalog().
Referenced by Lightweight::Driver::Odbc::OpenPrimaryKeysCatalog().
| LIGHTWEIGHT_API SqlResult Lightweight::Driver::Odbc::OpenForeignKeysCatalog | ( | Statement const & | stmt, |
| CatalogObjectName const & | primaryKeyTable, | ||
| CatalogObjectName const & | foreignKeyTable, | ||
| bool | wideText | ||
| ) |
Opens the SQLForeignKeys result set of the foreign keys between the primary-key table and the foreign-key table; an empty table name leaves that side open.
| stmt | The statement to open the result set on. |
| primaryKeyTable | The catalog name, the schema name and the name (empty for any) of the primary-key table. |
| foreignKeyTable | The catalog name, the schema name and the name (empty for any) of the foreign-key table. |
| wideText | Whether to call SQLForeignKeysW rather than SQLForeignKeys. |
SQLForeignKeys. OpenCatalog (see OpenCatalog below), which shared code calls with a Lightweight::Driver::SqlCatalogRequest. References Lightweight::Driver::Odbc::OpenForeignKeysCatalog().
Referenced by Lightweight::Driver::Odbc::OpenForeignKeysCatalog().
| LIGHTWEIGHT_API SqlResult Lightweight::Driver::Odbc::OpenStatisticsCatalog | ( | Statement const & | stmt, |
| CatalogObjectName const & | table, | ||
| bool | uniqueOnly, | ||
| bool | wideText | ||
| ) |
Opens the SQLStatistics result set of the indexes of table, with SQL_ENSURE.
| stmt | The statement to open the result set on. |
| table | The catalog name, the schema name and the table name. |
| uniqueOnly | SQL_INDEX_UNIQUE when set, otherwise SQL_INDEX_ALL. |
| wideText | Whether to call SQLStatisticsW rather than SQLStatistics. |
SQLStatistics. OpenCatalog (see OpenCatalog below), which shared code calls with a Lightweight::Driver::SqlCatalogRequest. References Lightweight::Driver::Odbc::OpenStatisticsCatalog().
Referenced by Lightweight::Driver::Odbc::OpenStatisticsCatalog().
| LIGHTWEIGHT_API std::expected< std::string, SqlErrorInfo > Lightweight::Driver::Odbc::SearchPatternEscape | ( | Connection const & | connection | ) |
Reads the driver's SQL_SEARCH_PATTERN_ESCAPE string through the ANSI SQLGetInfo, into a 32-byte buffer.
| connection | The connection to ask. |
| LIGHTWEIGHT_API SqlResult Lightweight::Driver::Odbc::OpenCatalog | ( | Statement const & | stmt, |
| SqlCatalogRequest const & | request | ||
| ) |
Opens the catalog result set request names: calls OpenTablesCatalog, OpenColumnsCatalog, OpenPrimaryKeysCatalog, OpenForeignKeysCatalog or OpenStatisticsCatalog with its arguments.
| stmt | The statement to open the result set on. |
| request | The catalog function and its arguments; wideText chooses the W entry point. |
References Lightweight::Driver::OpenCatalog().