@@ -15,11 +15,14 @@ use rocket::serde::{Deserialize, Serialize};
15
15
/// [default.databases.db_name]
16
16
/// url = "/path/to/db.sqlite"
17
17
///
18
- /// # only `url` is required. `Initializer` provides defaults for the rest .
18
+ /// # Only `url` is required. These have sane defaults and are optional .
19
19
/// min_connections = 64
20
20
/// max_connections = 1024
21
21
/// connect_timeout = 5
22
22
/// idle_timeout = 120
23
+ ///
24
+ /// # This option is only supported by the `sqlx_sqlite` driver.
25
+ /// extensions = ["memvfs", "rot13"]
23
26
/// ```
24
27
///
25
28
/// Alternatively, a custom provider can be used. For example, a custom `Figment`
@@ -36,6 +39,7 @@ use rocket::serde::{Deserialize, Serialize};
36
39
/// max_connections: 1024,
37
40
/// connect_timeout: 3,
38
41
/// idle_timeout: None,
42
+ /// extensions: None,
39
43
/// }));
40
44
///
41
45
/// rocket::custom(figment)
@@ -45,7 +49,8 @@ use rocket::serde::{Deserialize, Serialize};
45
49
/// For general information on configuration in Rocket, see [`rocket::config`].
46
50
/// For higher-level details on configuring a database, see the [crate-level
47
51
/// docs](crate#configuration).
48
- #[ derive( Serialize , Deserialize , Debug , Clone , PartialEq ) ]
52
+ // NOTE: Defaults provided by the figment created in the `Initializer` fairing.
53
+ #[ derive( Default , Serialize , Deserialize , Debug , Clone , PartialEq ) ]
49
54
#[ serde( crate = "rocket::serde" ) ]
50
55
pub struct Config {
51
56
/// Database-specific connection and configuration URL.
@@ -80,4 +85,11 @@ pub struct Config {
80
85
///
81
86
/// _Default:_ `None`.
82
87
pub idle_timeout : Option < u64 > ,
88
+ /// A list of database extensions to load at run-time.
89
+ ///
90
+ /// **Note:** Only the `sqlx_sqlite` driver supports this option (for SQLite
91
+ /// extensions) at this time. All other drivers ignore this option.
92
+ ///
93
+ /// _Default:_ `None`.
94
+ pub extensions : Option < Vec < String > > ,
83
95
}
0 commit comments