连接方法
用法
adbc_connection_get_info(connection, info_codes = NULL)
adbc_connection_get_objects(
connection,
depth = 0L,
catalog = NULL,
db_schema = NULL,
table_name = NULL,
table_type = NULL,
column_name = NULL
)
adbc_connection_get_table_schema(connection, catalog, db_schema, table_name)
adbc_connection_get_table_types(connection)
adbc_connection_read_partition(connection, serialized_partition)
adbc_connection_commit(connection)
adbc_connection_rollback(connection)
adbc_connection_cancel(connection)
adbc_connection_get_statistic_names(connection)
adbc_connection_get_statistics(
connection,
catalog,
db_schema,
table_name,
approximate = FALSE
)
adbc_connection_quote_identifier(connection, value, ...)
adbc_connection_quote_string(connection, value, ...)
参数
- connection
- info_codes
要获取的元数据代码列表,或者 NULL 获取全部。有效值记录在 adbc.h 头部中。
- depth
要显示的嵌套级别。 如果为 0,则显示所有级别。 如果为 1,则仅显示目录(即,catalog_schemas 将为 null)。 如果为 2,则仅显示目录和架构(即,db_schema_tables 将为 null)。 如果为 3,则仅显示目录、架构和表。
- catalog
仅显示给定目录中的表。 如果为 NULL,则不按目录进行过滤。 如果为空字符串,则仅显示没有目录的表。 可以是搜索模式。
- db_schema
仅显示给定数据库架构中的表。 如果为 NULL,则不按数据库架构进行过滤。 如果为空字符串,则仅显示没有数据库架构的表。 可以是搜索模式。
- table_name
限制特定表的对象或统计信息查询。 如果为 NULL,则不按名称进行过滤。 可以是搜索模式。
- table_type
仅显示与给定的表类型之一匹配的表。 如果为 NULL,则显示任何类型的表。 有效的表类型可以从 GetTableTypes 获取。 使用 NULL 条目终止列表。
- column_name
仅显示具有给定名称的列。 如果为 NULL,则不按名称进行过滤。 可以是搜索模式。
- serialized_partition
分区描述符。
- approximate
如果
FALSE
,则请求统计信息的精确值,否则允许尽力而为、近似值或缓存值。 数据库可能会返回近似值,无论如何,如结果所示。 请求精确值可能很昂贵或不受支持。- value
一个字符串或标识符。
- ...
驱动程序特定的选项。 对于默认方法,这些是转换为字符串的命名值。
值
adbc_connection_get_info()
,adbc_connection_get_objects()
,adbc_connection_get_table_types()
, 和adbc_connection_read_partition()
返回一个 nanoarrow_array_stream.adbc_connection_get_table_schema()
返回一个 nanoarrow_schenaadbc_connection_commit()
和adbc_connection_rollback()
返回connection
,不可见。
示例
db <- adbc_database_init(adbc_driver_void())
con <- adbc_connection_init(db)
# (not implemented by the void driver)
try(adbc_connection_get_info(con, 0))
#> Error in adbc_connection_get_info(con, 0) : NOT_IMPLEMENTED: GetInfo