pub struct Config {
pub in_path: OsString,
pub out_path: OsString,
pub target: Target,
pub package_name: String,
pub table_name_transform_fn: fn(Option<&str>, &str, Option<&str>) -> String,
pub enum_name_transform_fn: fn(Option<&str>, &str) -> String,
pub is_with_update_schema: bool,
pub is_with_create_schema: bool,
pub is_create_schema_primary_key_included: Option<bool>,
pub is_update_schema_primary_key_included: bool,
}Expand description
Configuration options for the code generation.
Fields§
§in_path: OsStringInput file path.
out_path: OsStringOutput file path.
target: TargetProtobuf target version.
package_name: StringOutput package name
table_name_transform_fn: fn(Option<&str>, &str, Option<&str>) -> StringA function for transforming the original table name from DBML. The default funciton is pascal casing and appending “Schema” to the name.
enum_name_transform_fn: fn(Option<&str>, &str) -> StringA function for transforming the original enum name from DBML. The default funciton is pascal casing and appending “Schema” to the name.
is_with_update_schema: boolOutput update schemas with optional all fields by default, entity’s primary key field is omitted.
is_with_create_schema: boolOuput create schemas with optional default fields. The entity’s primary key field is included when it is not being auto generated.
is_create_schema_primary_key_included: Option<bool>Forcing is_with_create_schema wether it should include primary key field or not.
is_update_schema_primary_key_included: boolConfig is_with_update_schema to include primary key field.