@@ -32,7 +32,8 @@ use std::{
3232use tracing_appender:: non_blocking:: WorkerGuard ;
3333use tracing_subscriber:: { layer:: SubscriberExt , util:: SubscriberInitExt , EnvFilter } ;
3434use turso_core:: {
35- Connection , Database , LimboError , OpenFlags , QueryMode , Statement , StepResult , Value ,
35+ Connection , Database , DatabaseOpts , LimboError , OpenFlags , QueryMode , Statement , StepResult ,
36+ Value ,
3637} ;
3738
3839#[ derive( Parser , Debug ) ]
@@ -80,6 +81,8 @@ pub struct Opts {
8081 pub experimental_encryption : bool ,
8182 #[ clap( long, help = "Enable experimental index method feature" ) ]
8283 pub experimental_index_method : bool ,
84+ #[ clap( long, help = "Enable experimental autovacuum feature" ) ]
85+ pub experimental_autovacuum : bool ,
8386}
8487
8588const PROMPT : & str = "turso> " ;
@@ -186,15 +189,17 @@ impl Limbo {
186189 . as_ref ( )
187190 . map_or ( ":memory:" . to_string ( ) , |p| p. to_string_lossy ( ) . to_string ( ) ) ;
188191 let indexes_enabled = opts. experimental_indexes . unwrap_or ( true ) ;
192+
189193 let ( io, conn) = if db_file. contains ( [ ':' , '?' , '&' , '#' ] ) {
190194 Connection :: from_uri (
191195 & db_file,
192- indexes_enabled,
193- opts. experimental_mvcc ,
194- opts. experimental_views ,
195- opts. experimental_strict ,
196- opts. experimental_encryption ,
197- opts. experimental_index_method ,
196+ DatabaseOpts :: new ( )
197+ . with_indexes ( indexes_enabled)
198+ . with_mvcc ( opts. experimental_mvcc )
199+ . with_views ( opts. experimental_views )
200+ . with_strict ( opts. experimental_strict )
201+ . with_encryption ( opts. experimental_encryption )
202+ . with_index_method ( opts. experimental_index_method ) ,
198203 ) ?
199204 } else {
200205 let flags = if opts. readonly {
@@ -213,6 +218,7 @@ impl Limbo {
213218 . with_strict ( opts. experimental_strict )
214219 . with_encryption ( opts. experimental_encryption )
215220 . with_index_method ( opts. experimental_index_method )
221+ . with_autovacuum ( opts. experimental_autovacuum )
216222 . turso_cli ( ) ,
217223 None ,
218224 ) ?;
0 commit comments