-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_tf.cpp
More file actions
21 lines (16 loc) · 1.01 KB
/
example_tf.cpp
File metadata and controls
21 lines (16 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void LoadInternal(DatabaseInstance &instance) {
// register the functions
// the table function
auto my_table_func = TableFunction("query_json_api", {positional_arg_0}, my_table_function, my_bind_function, my_init_function);
my_table_func.filter_pushdown = false;
my_table_func.projection_pushdown = true;
my_table_func.cardinality = my_cardinality_function;
my_table_func.pushdown_complex_filter = PushdownComplexFilter;
my_table_func.named_parameters["options"] = LogicalType::VARCHAR;
my_table_func.named_parameters["api"] = LogicalType::VARCHAR;
ExtensionUtil::RegisterFunction(instance, my_table_func);
auto &config = DBConfig::GetConfig(instance);
// SET or PRAGMA settings with default, ie in ~/.duckdbrc
config.AddExtensionOption("rest_api_config_file", "REST API Config File Location", LogicalType::VARCHAR,
Value("/users/thisguy/rest_api_extension.json"));
}