better_duck_core::config::Config (re-exported as better_duck_core::Config) is a builder that
collects DuckDB open-time settings. Pass the finished builder to a *_with_flags
constructor.
Every setter returns Result<Config>, because DuckDB validates each key/value as it is set — so
chain with ?:
Config is Send. It is consumed by the constructor you pass it to.
Typed setters
Automatic, ReadOnly, or ReadWrite.Default
ORDER BY direction: Asc or Desc.Where NULLs sort:
NullsFirst or NullsLast.Worker-thread count for query execution.
Memory limit, e.g.
"512MB", "2GB".Whether DuckDB may touch the filesystem/network (needed to install extensions, read files). On
by default.
Cache parsed objects (e.g. Parquet metadata) between queries.
Autoload known extensions on first use.
Permit loading unsigned extension binaries. Takes no argument.
Appends to the user-agent DuckDB reports (telemetry/diagnostics).
The generic escape hatch
with(key, value) accepts any DuckDB setting name as strings. DuckDB errors on an unknown or
invalid setting. An interior NUL in a key or value is rejected as Error::NulError.
open_with_flags internally sets duckdb_api = "rust" for you; you never need to set it.Discovering available flags at runtime
DuckDB can enumerate its own settings, whichConfig surfaces as associated functions:
Config::flag_count() -> usize— number of known flags.Config::flag(index) -> Option<ConfigFlag>— the flag atindex, asConfigFlag { name: String, description: String }.Config::flags() -> impl Iterator<Item = ConfigFlag>— iterate all of them.
Library version
min_duckdb_version of a
loadable extension.
See also
- Opening connections — the
*_with_flagsconstructors. - Extensions —
allow_unsigned_extensionsandenable_external_accessin context. - Feature flags — build-time Cargo features (distinct from these runtime settings).