Skip to content

Commit

Permalink
better error message when not able to determine the sql type
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcmicu committed Feb 5, 2024
1 parent 08620db commit 844d656
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3000,15 +3000,13 @@ pub fn get_table_constraints(
}

for row in colvals {
let sql_type = get_sql_type(
datatypes_config,
&row.get("datatype")
.and_then(|d| d.as_str())
.and_then(|s| Some(s.to_string()))
.unwrap(),
pool,
)
.unwrap();
let datatype = row
.get("datatype")
.and_then(|d| d.as_str())
.and_then(|s| Some(s.to_string()))
.unwrap();
let sql_type = get_sql_type(datatypes_config, &datatype, pool)
.expect(&format!("Unable to determine SQL type for {}", datatype));
let column_name = row.get("column").and_then(|s| s.as_str()).unwrap();
let structure = row.get("structure").and_then(|s| s.as_str());
if let Some(structure) = structure {
Expand Down

0 comments on commit 844d656

Please sign in to comment.