@@ -15,13 +15,14 @@ use std::path::Path;
15
15
16
16
use anyhow:: Result ;
17
17
18
- pub use self :: {
19
- backend:: { BackendOptions , StorageMode , TurboTasksBackend } ,
20
- kv_backing_storage:: KeyValueDatabaseBackingStorage ,
21
- } ;
22
18
use crate :: database:: {
23
19
db_versioning:: handle_db_versioning, noop_kv:: NoopKvDb , turbo:: TurboKeyValueDatabase ,
24
20
} ;
21
+ pub use crate :: {
22
+ backend:: { BackendOptions , StorageMode , TurboTasksBackend } ,
23
+ database:: db_versioning:: GitVersionInfo ,
24
+ kv_backing_storage:: KeyValueDatabaseBackingStorage ,
25
+ } ;
25
26
26
27
#[ cfg( feature = "lmdb" ) ]
27
28
pub type LmdbBackingStorage = KeyValueDatabaseBackingStorage <
@@ -35,7 +36,10 @@ pub type LmdbBackingStorage = KeyValueDatabaseBackingStorage<
35
36
> ;
36
37
37
38
#[ cfg( feature = "lmdb" ) ]
38
- pub fn lmdb_backing_storage ( path : & Path , version_info : & str ) -> Result < LmdbBackingStorage > {
39
+ pub fn lmdb_backing_storage (
40
+ path : & Path ,
41
+ version_info : & GitVersionInfo ,
42
+ ) -> Result < LmdbBackingStorage > {
39
43
use crate :: database:: {
40
44
fresh_db_optimization:: { is_fresh, FreshDbOptimization } ,
41
45
read_transaction_cache:: ReadTransactionCache ,
@@ -53,7 +57,10 @@ pub fn lmdb_backing_storage(path: &Path, version_info: &str) -> Result<LmdbBacki
53
57
54
58
pub type TurboBackingStorage = KeyValueDatabaseBackingStorage < TurboKeyValueDatabase > ;
55
59
56
- pub fn turbo_backing_storage ( path : & Path , version_info : & str ) -> Result < TurboBackingStorage > {
60
+ pub fn turbo_backing_storage (
61
+ path : & Path ,
62
+ version_info : & GitVersionInfo ,
63
+ ) -> Result < TurboBackingStorage > {
57
64
let path = handle_db_versioning ( path, version_info) ?;
58
65
let database = TurboKeyValueDatabase :: new ( path) ?;
59
66
Ok ( KeyValueDatabaseBackingStorage :: new ( database) )
@@ -69,14 +76,20 @@ pub fn noop_backing_storage() -> NoopBackingStorage {
69
76
pub type DefaultBackingStorage = LmdbBackingStorage ;
70
77
71
78
#[ cfg( feature = "lmdb" ) ]
72
- pub fn default_backing_storage ( path : & Path , version_info : & str ) -> Result < DefaultBackingStorage > {
79
+ pub fn default_backing_storage (
80
+ path : & Path ,
81
+ version_info : & GitVersionInfo ,
82
+ ) -> Result < DefaultBackingStorage > {
73
83
lmdb_backing_storage ( path, version_info)
74
84
}
75
85
76
86
#[ cfg( not( feature = "lmdb" ) ) ]
77
87
pub type DefaultBackingStorage = TurboBackingStorage ;
78
88
79
89
#[ cfg( not( feature = "lmdb" ) ) ]
80
- pub fn default_backing_storage ( path : & Path , version_info : & str ) -> Result < DefaultBackingStorage > {
90
+ pub fn default_backing_storage (
91
+ path : & Path ,
92
+ version_info : & GitVersionInfo ,
93
+ ) -> Result < DefaultBackingStorage > {
81
94
turbo_backing_storage ( path, version_info)
82
95
}
0 commit comments