From 2412513fcf8ac07ea4c462cac60ca1340e2c0c16 Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Fri, 10 Feb 2023 13:04:12 -0800 Subject: [PATCH] allow unsigned extensions --- src/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config.rs b/src/config.rs index e5368714..3c1910e8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -86,6 +86,12 @@ impl Config { Ok(self) } + /// Allow to load third-party duckdb extensions. + pub fn allow_unsigned_extensions(mut self) -> Result { + self.set("allow_unsigned_extensions", "true")?; + Ok(self) + } + /// The maximum memory of the system (e.g. 1GB) pub fn max_memory(mut self, memory: &str) -> Result { self.set("max_memory", memory)?; @@ -172,6 +178,7 @@ mod test { .default_order(crate::DefaultOrder::Desc)? .enable_external_access(true)? .enable_object_cache(false)? + .allow_unsigned_extensions()? .max_memory("2GB")? .threads(4)?; let db = Connection::open_in_memory_with_flags(config)?;