File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 3
3
#[ cfg_attr(
4
4
feature = "sqlx-toml" ,
5
5
derive( serde:: Deserialize ) ,
6
- serde( default , rename_all = "kebab-case" )
6
+ serde( default , rename_all = "kebab-case" , deny_unknown_fields )
7
7
) ]
8
8
pub struct Config {
9
9
/// Override the database URL environment variable.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::collections::BTreeMap;
5
5
#[ cfg_attr(
6
6
feature = "sqlx-toml" ,
7
7
derive( serde:: Deserialize ) ,
8
- serde( default , rename_all = "kebab-case" )
8
+ serde( default , rename_all = "kebab-case" , deny_unknown_fields )
9
9
) ]
10
10
pub struct Config {
11
11
/// Specify which crates' types to use when types from multiple crates apply.
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use std::collections::BTreeSet;
16
16
#[ cfg_attr(
17
17
feature = "sqlx-toml" ,
18
18
derive( serde:: Deserialize ) ,
19
- serde( default , rename_all = "kebab-case" )
19
+ serde( default , rename_all = "kebab-case" , deny_unknown_fields )
20
20
) ]
21
21
pub struct Config {
22
22
/// Specify the names of schemas to create if they don't already exist.
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ mod tests;
48
48
#[ cfg_attr(
49
49
feature = "sqlx-toml" ,
50
50
derive( serde:: Deserialize ) ,
51
- serde( default , rename_all = "kebab-case" )
51
+ serde( default , rename_all = "kebab-case" , deny_unknown_fields )
52
52
) ]
53
53
pub struct Config {
54
54
/// Configuration shared by multiple components.
@@ -210,6 +210,9 @@ impl Config {
210
210
// Only returned if the file exists but the feature is not enabled.
211
211
panic ! ( "{e}" )
212
212
}
213
+ Err ( ConfigError :: Parse { error, path } ) => {
214
+ panic ! ( "error parsing sqlx config {path:?}: {error}" )
215
+ }
213
216
Err ( e) => {
214
217
panic ! ( "failed to read sqlx config: {e}" )
215
218
}
You can’t perform that action at this time.
0 commit comments