ADBC
Arrow Database Connectivity
Loading...
Searching...
No Matches
Catalog Utilities

Classes

struct  adbc::driver::GetObjectsHelper
 Helper to implement GetObjects. More...
 
struct  adbc::driver::GetObjectsHelper::Table
 
struct  adbc::driver::GetObjectsHelper::ColumnXdbc
 
struct  adbc::driver::GetObjectsHelper::Column
 
struct  adbc::driver::GetObjectsHelper::ConstraintUsage
 
struct  adbc::driver::GetObjectsHelper::Constraint
 
struct  adbc::driver::InfoValue
 Representation of a single item in an array to be returned from AdbcConnectionGetInfo(). More...
 

Enumerations

enum class  adbc::driver::GetObjectsDepth { kCatalogs , kSchemas , kTables , kColumns }
 The GetObjects level. More...
 

Functions

Status adbc::driver::MakeGetObjectsSchema (ArrowSchema *schema)
 Create the ArrowSchema for AdbcConnectionGetObjects().
 
Status adbc::driver::GetObjectsHelper::Close ()
 
virtual Status adbc::driver::GetObjectsHelper::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 data up front.
 
virtual Status adbc::driver::GetObjectsHelper::LoadCatalogs (std::optional< std::string_view > catalog_filter)
 
virtual Result< std::optional< std::string_view > > adbc::driver::GetObjectsHelper::NextCatalog ()
 
virtual Status adbc::driver::GetObjectsHelper::LoadSchemas (std::string_view catalog, std::optional< std::string_view > schema_filter)
 
virtual Result< std::optional< std::string_view > > adbc::driver::GetObjectsHelper::NextSchema ()
 
virtual Status adbc::driver::GetObjectsHelper::LoadTables (std::string_view catalog, std::string_view schema, std::optional< std::string_view > table_filter, const std::vector< std::string_view > &table_types)
 
virtual Result< std::optional< Table > > adbc::driver::GetObjectsHelper::NextTable ()
 
virtual Status adbc::driver::GetObjectsHelper::LoadColumns (std::string_view catalog, std::string_view schema, std::string_view table, std::optional< std::string_view > column_filter)
 
virtual Result< std::optional< Column > > adbc::driver::GetObjectsHelper::NextColumn ()
 
virtual Result< std::optional< Constraint > > adbc::driver::GetObjectsHelper::NextConstraint ()
 
Status adbc::driver::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.
 
void adbc::driver::MakeEmptyStream (ArrowSchema *schema, ArrowArrayStream *out)
 Create an ArrowArrayStream with zero batches from a given ArrowSchema.
 
void adbc::driver::MakeArrayStream (ArrowSchema *schema, ArrowArray *array, ArrowArrayStream *out)
 Create an ArrowArrayStream from a given ArrowSchema and ArrowArray.
 
Status adbc::driver::MakeTableTypesStream (const std::vector< std::string > &table_types, ArrowArrayStream *out)
 Create an ArrowArrayStream representation of a vector of table types.
 
Status adbc::driver::MakeGetInfoStream (const std::vector< InfoValue > &infos, ArrowArrayStream *out)
 Create an ArrowArrayStream to be returned from AdbcConnectionGetInfo().
 

Variables

std::string_view adbc::driver::GetObjectsHelper::Table::name
 
std::string_view adbc::driver::GetObjectsHelper::Table::type
 
std::optional< int16_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_data_type
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_type_name
 
std::optional< int32_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_column_size
 
std::optional< int16_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_decimal_digits
 
std::optional< int16_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_num_prec_radix
 
std::optional< int16_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_nullable
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_column_def
 
std::optional< int16_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_sql_data_type
 
std::optional< int16_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_datetime_sub
 
std::optional< int32_t > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_char_octet_length
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_is_nullable
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_scope_catalog
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_scope_schema
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_scope_table
 
std::optional< bool > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_is_autoincrement
 
std::optional< bool > adbc::driver::GetObjectsHelper::ColumnXdbc::xdbc_is_generatedcolumn
 
std::string_view adbc::driver::GetObjectsHelper::Column::column_name
 
int32_t adbc::driver::GetObjectsHelper::Column::ordinal_position
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::Column::remarks
 
std::optional< ColumnXdbcadbc::driver::GetObjectsHelper::Column::xdbc
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ConstraintUsage::catalog
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::ConstraintUsage::schema
 
std::string_view adbc::driver::GetObjectsHelper::ConstraintUsage::table
 
std::string_view adbc::driver::GetObjectsHelper::ConstraintUsage::column
 
std::optional< std::string_view > adbc::driver::GetObjectsHelper::Constraint::name
 
std::string_view adbc::driver::GetObjectsHelper::Constraint::type
 
std::vector< std::string_view > adbc::driver::GetObjectsHelper::Constraint::column_names
 
std::optional< std::vector< ConstraintUsage > > adbc::driver::GetObjectsHelper::Constraint::usage
 

Detailed Description

Utilities for implementing catalog/metadata-related functions.


Class Documentation

◆ adbc::driver::GetObjectsHelper

struct adbc::driver::GetObjectsHelper

Helper to implement GetObjects.

Drivers can implement methods of the GetObjectsHelper in a driver-specific class to get a compliant implementation of AdbcConnectionGetObjects().

Public Member Functions

Status Close ()
 
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 data up front.
 
virtual Status LoadCatalogs (std::optional< std::string_view > catalog_filter)
 
virtual Result< std::optional< std::string_view > > NextCatalog ()
 
virtual Status LoadSchemas (std::string_view catalog, std::optional< std::string_view > schema_filter)
 
virtual Result< std::optional< std::string_view > > NextSchema ()
 
virtual Status LoadTables (std::string_view catalog, std::string_view schema, std::optional< std::string_view > table_filter, const std::vector< std::string_view > &table_types)
 
virtual Result< std::optional< Table > > NextTable ()
 
virtual Status LoadColumns (std::string_view catalog, std::string_view schema, std::string_view table, std::optional< std::string_view > column_filter)
 
virtual Result< std::optional< Column > > NextColumn ()
 
virtual Result< std::optional< Constraint > > NextConstraint ()
 

◆ adbc::driver::GetObjectsHelper::Table

struct adbc::driver::GetObjectsHelper::Table

Public Attributes

std::string_view name
 
std::string_view type
 

◆ adbc::driver::GetObjectsHelper::ColumnXdbc

struct adbc::driver::GetObjectsHelper::ColumnXdbc

Public Attributes

std::optional< int16_t > xdbc_data_type
 
std::optional< std::string_view > xdbc_type_name
 
std::optional< int32_t > xdbc_column_size
 
std::optional< int16_t > xdbc_decimal_digits
 
std::optional< int16_t > xdbc_num_prec_radix
 
std::optional< int16_t > xdbc_nullable
 
std::optional< std::string_view > xdbc_column_def
 
std::optional< int16_t > xdbc_sql_data_type
 
std::optional< int16_t > xdbc_datetime_sub
 
std::optional< int32_t > xdbc_char_octet_length
 
std::optional< std::string_view > xdbc_is_nullable
 
std::optional< std::string_view > xdbc_scope_catalog
 
std::optional< std::string_view > xdbc_scope_schema
 
std::optional< std::string_view > xdbc_scope_table
 
std::optional< bool > xdbc_is_autoincrement
 
std::optional< bool > xdbc_is_generatedcolumn
 

◆ adbc::driver::GetObjectsHelper::Column

struct adbc::driver::GetObjectsHelper::Column

Public Attributes

std::string_view column_name
 
int32_t ordinal_position
 
std::optional< std::string_view > remarks
 
std::optional< ColumnXdbcxdbc
 

◆ adbc::driver::GetObjectsHelper::ConstraintUsage

struct adbc::driver::GetObjectsHelper::ConstraintUsage

Public Attributes

std::optional< std::string_view > catalog
 
std::optional< std::string_view > schema
 
std::string_view table
 
std::string_view column
 

◆ adbc::driver::GetObjectsHelper::Constraint

struct adbc::driver::GetObjectsHelper::Constraint

Public Attributes

std::optional< std::string_view > name
 
std::string_view type
 
std::vector< std::string_view > column_names
 
std::optional< std::vector< ConstraintUsage > > usage
 

◆ adbc::driver::InfoValue

struct adbc::driver::InfoValue

Representation of a single item in an array to be returned from AdbcConnectionGetInfo().

Public Member Functions

 InfoValue (uint32_t code, std::variant< std::string, int64_t > value)
 
 InfoValue (uint32_t code, const char *value)
 

Public Attributes

uint32_t code
 
std::variant< std::string, int64_t > value
 

Enumeration Type Documentation

◆ GetObjectsDepth

enum class adbc::driver::GetObjectsDepth
strong

The GetObjects level.

Function Documentation

◆ BuildGetObjects()

Status adbc::driver::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.

◆ Load()

virtual Status adbc::driver::GetObjectsHelper::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 )
inlinevirtual

Fetch all metadata needed. The driver is free to delay loading but this gives it a chance to load data up front.

◆ MakeArrayStream()

void adbc::driver::MakeArrayStream ( ArrowSchema * schema,
ArrowArray * array,
ArrowArrayStream * out )

Create an ArrowArrayStream from a given ArrowSchema and ArrowArray.

The resulting ArrowArrayStream will contain zero batches if the length of the array is zero, or exactly one batch if the length of the array is non-zero. This function takes ownership of schema and array; the caller is responsible for releasing out.

◆ MakeEmptyStream()

void adbc::driver::MakeEmptyStream ( ArrowSchema * schema,
ArrowArrayStream * out )

Create an ArrowArrayStream with zero batches from a given ArrowSchema.

This function takes ownership of schema; the caller is responsible for releasing out.

◆ MakeGetInfoStream()

Status adbc::driver::MakeGetInfoStream ( const std::vector< InfoValue > & infos,
ArrowArrayStream * out )

Create an ArrowArrayStream to be returned from AdbcConnectionGetInfo().

The caller is responsible for releasing out on success.

◆ MakeGetObjectsSchema()

Status adbc::driver::MakeGetObjectsSchema ( ArrowSchema * schema)

Create the ArrowSchema for AdbcConnectionGetObjects().

◆ MakeTableTypesStream()

Status adbc::driver::MakeTableTypesStream ( const std::vector< std::string > & table_types,
ArrowArrayStream * out )

Create an ArrowArrayStream representation of a vector of table types.

Create an ArrowArrayStream representation of an array of table types that can be used to implement AdbcConnectionGetTableTypes(). The caller is responsible for releasing out on success.