File tree Expand file tree Collapse file tree 2 files changed +2
-20
lines changed
Expand file tree Collapse file tree 2 files changed +2
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -45,18 +45,16 @@ pub struct BackendManager {
4545
4646impl BackendManager {
4747 /// Creates a new `BackendManager`.
48- pub async fn new ( ) -> StorageResult < Self > {
48+ pub async fn new ( database_url : Option < & str > ) -> StorageResult < Self > {
4949 Ok ( Self {
50- db : Database :: connect ( DATABASE_URL ) . await ?,
50+ db : Database :: connect ( database_url . unwrap_or ( DATABASE_URL ) ) . await ?,
5151 latest_epoch_id : AtomicUsize :: new ( 0 ) ,
5252 } )
5353 }
5454}
5555
5656pub const DATABASE_URL : & str = "sqlite:./sqlite.db?mode=rwc" ;
5757pub const DATABASE_FILE : & str = "./sqlite.db" ;
58- pub const TEST_DATABASE_URL : & str = "sqlite:./test.db?mode=rwc" ;
59- pub const TEST_DATABASE_FILE : & str = "./test.db" ;
6058
6159pub async fn migrate ( db : & DatabaseConnection ) -> Result < ( ) , DbErr > {
6260 Migrator :: refresh ( db) . await
You can’t perform that action at this time.
0 commit comments