26#include "driver/framework/type_fwd.h"
28namespace adbc::driver {
54 std::string_view name;
55 std::string_view type;
59 std::optional<int16_t> xdbc_data_type;
60 std::optional<std::string_view> xdbc_type_name;
61 std::optional<int32_t> xdbc_column_size;
62 std::optional<int16_t> xdbc_decimal_digits;
63 std::optional<int16_t> xdbc_num_prec_radix;
64 std::optional<int16_t> xdbc_nullable;
65 std::optional<std::string_view> xdbc_column_def;
66 std::optional<int16_t> xdbc_sql_data_type;
67 std::optional<int16_t> xdbc_datetime_sub;
68 std::optional<int32_t> xdbc_char_octet_length;
69 std::optional<std::string_view> xdbc_is_nullable;
70 std::optional<std::string_view> xdbc_scope_catalog;
71 std::optional<std::string_view> xdbc_scope_schema;
72 std::optional<std::string_view> xdbc_scope_table;
73 std::optional<bool> xdbc_is_autoincrement;
74 std::optional<bool> xdbc_is_generatedcolumn;
78 std::string_view column_name;
79 int32_t ordinal_position;
80 std::optional<std::string_view> remarks;
81 std::optional<ColumnXdbc> xdbc;
85 std::optional<std::string_view> catalog;
86 std::optional<std::string_view> schema;
87 std::string_view table;
88 std::string_view column;
92 std::optional<std::string_view> name;
93 std::string_view type;
94 std::vector<std::string_view> column_names;
95 std::optional<std::vector<ConstraintUsage>> usage;
98 Status Close() {
return status::Ok(); }
103 std::optional<std::string_view> catalog_filter,
104 std::optional<std::string_view> schema_filter,
105 std::optional<std::string_view> table_filter,
106 std::optional<std::string_view> column_filter,
107 const std::vector<std::string_view>& table_types) {
108 return status::NotImplemented(
"GetObjects");
111 virtual Status LoadCatalogs(std::optional<std::string_view> catalog_filter) {
112 return status::NotImplemented(
"GetObjects at depth = catalog");
115 virtual Result<std::optional<std::string_view>> NextCatalog() {
return std::nullopt; }
117 virtual Status LoadSchemas(std::string_view catalog,
118 std::optional<std::string_view> schema_filter) {
119 return status::NotImplemented(
"GetObjects at depth = schema");
122 virtual Result<std::optional<std::string_view>> NextSchema() {
return std::nullopt; }
124 virtual Status LoadTables(std::string_view catalog, std::string_view schema,
125 std::optional<std::string_view> table_filter,
126 const std::vector<std::string_view>& table_types) {
127 return status::NotImplemented(
"GetObjects at depth = table");
130 virtual Result<std::optional<Table>> NextTable() {
return std::nullopt; }
132 virtual Status LoadColumns(std::string_view catalog, std::string_view schema,
133 std::string_view table,
134 std::optional<std::string_view> column_filter) {
135 return status::NotImplemented(
"GetObjects at depth = column");
138 virtual Result<std::optional<Column>> NextColumn() {
return std::nullopt; }
140 virtual Result<std::optional<Constraint>> NextConstraint() {
return std::nullopt; }
146 std::optional<std::string_view> catalog_filter,
147 std::optional<std::string_view> schema_filter,
148 std::optional<std::string_view> table_filter,
149 std::optional<std::string_view> column_filter,
150 const std::vector<std::string_view>& table_types,
151 ArrowArrayStream* out);
A wrapper around AdbcStatusCode + AdbcError.
Definition status.h:43
GetObjectsDepth
The GetObjects level.
Definition objects.h:39
Status MakeGetObjectsSchema(ArrowSchema *schema)
Create the ArrowSchema for AdbcConnectionGetObjects().
Status BuildGetObjects(GetObjectsHelper *helper, GetObjectsDepth depth, std::optional< std::string_view > catalog_filter, std::optional< std::string_view > schema_filter, std::optional< std::string_view > table_filter, std::optional< std::string_view > column_filter, const std::vector< std::string_view > &table_types, ArrowArrayStream *out)
A helper that implements GetObjects. The out/helper lifetime are caller-managed.
virtual Status Load(GetObjectsDepth depth, std::optional< std::string_view > catalog_filter, std::optional< std::string_view > schema_filter, std::optional< std::string_view > table_filter, std::optional< std::string_view > column_filter, const std::vector< std::string_view > &table_types)
Fetch all metadata needed. The driver is free to delay loading but this gives it a chance to load dat...
Definition objects.h:102
Helper to implement GetObjects.
Definition objects.h:50