File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,15 +20,22 @@ async fn main() {
2020 } )
2121 . replace ( "libsql" , "https" ) ;
2222
23- let encryption_config = EncryptionConfig {
24- cipher : Cipher :: Aes256Cbc ,
25- encryption_key : "s3cr3t" . into ( ) ,
23+ let db = if cfg ! ( feature = "encryption" ) {
24+ let encryption_config = EncryptionConfig {
25+ cipher : Cipher :: Aes256Cbc ,
26+ encryption_key : "s3cr3t" . into ( ) ,
27+ } ;
28+ Builder :: new_remote_replica ( db_file. path ( ) , url, auth_token)
29+ . encryption_config ( encryption_config)
30+ . build ( )
31+ . await
32+ . unwrap ( )
33+ } else {
34+ Builder :: new_remote_replica ( db_file. path ( ) , url, auth_token)
35+ . build ( )
36+ . await
37+ . unwrap ( )
2638 } ;
27- let db = Builder :: new_remote_replica ( db_file. path ( ) , url, auth_token)
28- . encryption_config ( encryption_config)
29- . build ( )
30- . await
31- . unwrap ( ) ;
3239
3340 let conn = db. connect ( ) . unwrap ( ) ;
3441
You can’t perform that action at this time.
0 commit comments