Repository: diesel-rs/diesel
File: diesel_cli/src/config.rs (Rust)

Code before:
    pub file: Option<PathBuf>,
    #[serde(default)]
    pub with_docs: print_schema::DocConfig,
    #[serde(default)]
    pub allow_tables_to_appear_in_same_query_config:
        print_schema::AllowTablesToAppearInSameQueryConfig,
    #[serde(default)]
    pub filter: Filtering,
    #[serde(default)]
    pub column_sorting: ColumnSorting,
    #[serde(default)]
    pub schema: Option<String>,
    #[serde(default)]
    pub patch_file: Option<PathBuf>,
    #[serde(default)]
    pub import_types: Option<Vec<String>>,
    #[serde(default)]
    pub generate_missing_sql_type_definitions: Option<bool>,
    #[serde(default)]
    pub except_custom_type_definitions: Vec<Regex>,
    #[serde(default)]
    pub custom_type_derives: Option<Vec<String>>,
    #[serde(default)]
    pub sqlite_integer_primary_key_is_bigint: Option<bool>,
    #[serde(default)]
    pub domains_as_custom_types: Vec<Regex>,
}

impl PrintSchema {
    pub fn generate_missing_sql_type_definitions(&self) -> bool {
        self.generate_missing_sql_type_definitions.unwrap_or(true)
    }

    pub fn schema_name(&self) -> Option<&str> {
        self.schema.as_deref()
    }

    pub fn import_types(&self) -> Option<&[String]> {
        self.import_types.as_deref()
    }

    // it's a false positive
    // https://github.com/rust-lang/rust-clippy/issues/12856
    #[allow(clippy::needless_borrows_for_generic_args)]
    fn set_relative_path_base(&mut self, base: &Path) {
        if let Some(ref mut file) = self.file {
            if file.is_relative() {
                *file = base.join(&file);
            }
        }


Review comment (suggestion):
```suggestion
    pub pg_domains_as_custom_types: Vec<Regex>,
```

To make clear that this is a postgres specific option.

Code after:
        }
    }
}

#[derive(Default, Deserialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PrintSchema {
    #[serde(default)]
    pub file: Option<PathBuf>,
    #[serde(default)]
    pub with_docs: print_schema::DocConfig,
    #[serde(default)]
    pub allow_tables_to_appear_in_same_query_config:
        print_schema::AllowTablesToAppearInSameQueryConfig,
    #[serde(default)]
    pub filter: Filtering,
    #[serde(default)]
    pub column_sorting: ColumnSorting,
    #[serde(default)]
    pub schema: Option<String>,
    #[serde(default)]
    pub patch_file: Option<PathBuf>,
    #[serde(default)]
    pub import_types: Option<Vec<String>>,
    #[serde(default)]
    pub generate_missing_sql_type_definitions: Option<bool>,
    #[serde(default)]
    pub except_custom_type_definitions: Vec<Regex>,
    #[serde(default)]
    pub custom_type_derives: Option<Vec<String>>,
    #[serde(default)]
    pub sqlite_integer_primary_key_is_bigint: Option<bool>,
    #[serde(default)]
    pub pg_domains_as_custom_types: Vec<Regex>,
}

impl PrintSchema {
    pub fn generate_missing_sql_type_definitions(&self) -> bool {
        self.generate_missing_sql_type_definitions.unwrap_or(true)
    }

    pub fn schema_name(&self) -> Option<&str> {
        self.schema.as_deref()
    }

    pub fn import_types(&self) -> Option<&[String]> {
        self.import_types.as_deref()
    }

    // it's a false positive
    // https://github.com/rust-lang/rust-clippy/issues/12856