Closed esevastyanov closed 7 months ago
Thanks @esevastyanov for reporting this. Indeed very interesting. When listing all available config options using
count := C.duckdb_config_count()
for i := range count {
var (
name *C.char
desc *C.char
)
state := C.duckdb_get_config_flag(i, &name, &desc)
fmt.Println(state, i, C.GoString(name), C.GoString(desc))
}
schema
and search_path
are available. See the output above:
0 54 schema Sets the default search schema. Equivalent to setting search_path to a single value.
0 55 search_path Sets the default catalog search path as a comma-separated list of values
@taniabogatsch Do you have an idea, why DuckDB disallows to set the via duckdb_set_config()
?
I'll try to reproduce this in C and get back to you. Feel free to assign me to this issue.
Both search_path
and schema
are DUCKDB_LOCAL
settings, which must be set per connection. I.e., you can only set them after creating at least the duckdb instance (SET schema=main;
) , i.e., via the bootQueries
of the connector. duckdb_set_config
can only take global settings. We'll try to improve this in the documentation. I'll also look into returning a better error message through the C API.
We can close this after merging #182. We'll improve this in our documentation and potentially have a look at the C API. But it is not a go-duckdb issue.
DSN:
primary.db?schema=main
orprimary.db?search_path=main
Code:Error:
or
Expected behaviour: no error