Skip to content

Commit de5851f

Browse files
committed
Added a small change to automatically convert snake_case type names to CamelCase.
1 parent b596ef9 commit de5851f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • diesel_cli/src/infer_schema_internals

diesel_cli/src/infer_schema_internals/pg.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ pub fn determine_column_type(attr: &ColumnInformation) -> Result<ColumnType, Box
2727
)?;
2828
}
2929

30+
let rust_name = tpe
31+
.split('_')
32+
.map(|word| capitalize(word))
33+
.collect::<String>();
34+
3035
Ok(ColumnType {
31-
rust_name: capitalize(tpe),
36+
rust_name,
3237
is_array,
3338
is_nullable: attr.nullable,
3439
is_unsigned: false,

0 commit comments

Comments
 (0)