File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ impl Config {
5252 self . config . unwrap_or ( std:: ptr:: null_mut ( ) as ffi:: duckdb_config )
5353 }
5454
55+ /// enable autoload extensions
56+ pub fn enable_autoload_extension ( mut self , enabled : bool ) -> Result < Config > {
57+ self . set ( "autoinstall_known_extensions" , & ( enabled as i32 ) . to_string ( ) ) ?;
58+ self . set ( "autoload_known_extensions" , & ( enabled as i32 ) . to_string ( ) ) ?;
59+ Ok ( self )
60+ }
61+
5562 /// Access mode of the database ([AUTOMATIC], READ_ONLY or READ_WRITE)
5663 pub fn access_mode ( mut self , mode : AccessMode ) -> Result < Config > {
5764 self . set ( "access_mode" , & mode. to_string ( ) ) ?;
@@ -174,6 +181,7 @@ mod test {
174181 . default_order ( crate :: DefaultOrder :: Desc ) ?
175182 . enable_external_access ( true ) ?
176183 . enable_object_cache ( false ) ?
184+ . enable_autoload_extension ( true ) ?
177185 . allow_unsigned_extensions ( ) ?
178186 . max_memory ( "2GB" ) ?
179187 . threads ( 4 ) ?;
You can’t perform that action at this time.
0 commit comments