Class: DuckDB::TableFunction::InitInfo
- Inherits:
-
Object
- Object
- DuckDB::TableFunction::InitInfo
- Defined in:
- lib/duckdb/table_function/init_info.rb,
ext/duckdb/table_function_init_info.c
Overview
The DuckDB::TableFunction::InitInfo provides context during table function initialization.
It is passed to the init callback to set up execution state.
Example:
table_function.init do |init_info|
# Initialize execution state
# Can report errors if initialization fails
init_info.set_error('Initialization failed')
end
rubocop:disable Lint/EmptyClass
Instance Method Summary collapse
-
#set_error(error_message) ⇒ self
Sets an error message for the init phase.
Instance Method Details
#set_error(error_message) ⇒ self
Sets an error message for the init phase. This will cause the query to fail with the specified error.
init_info.set_error('Invalid initialization')
45 46 47 48 49 50 51 52 53 54 55 |
# File 'ext/duckdb/table_function_init_info.c', line 45
static VALUE rbduckdb_init_info_set_error(VALUE self, VALUE error) {
rubyDuckDBInitInfo *ctx;
const char *error_msg;
TypedData_Get_Struct(self, rubyDuckDBInitInfo, &init_info_data_type, ctx);
error_msg = StringValueCStr(error);
duckdb_init_set_error(ctx->info, error_msg);
return self;
}
|