pub struct GenerationConfig<'a> {
pub connection_type: String,
pub options: GenerationConfigOpts<'a>,
}Expand description
Global config, not table specific
Fields§
§connection_type: StringConnection type to insert
For example:
diesel::pg::PgConnectiondiesel::sqlite::SqliteConnectiondiesel::mysql::MysqlConnectiondiesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::pg::PgConnection>>- or, your custom diesel connection type (struct which implements
diesel::connection::Connection)
options: GenerationConfigOpts<'a>Optional Options
GenerationConfig {
// ... all required options
options: Default::default(),
};
// or
GenerationConfig {
// ... all required options
options: GenerationConfigOpts {
..Default::default()
},
};Implementations§
Source§impl<'a> GenerationConfig<'a>
impl<'a> GenerationConfig<'a>
Sourcepub fn new<C: Into<String>>(connection_type: C) -> Self
pub fn new<C: Into<String>>(connection_type: C) -> Self
Create a new Instance with default GenerationConfigOpts
Builder
Sourcepub fn with_options(self, options: GenerationConfigOpts<'a>) -> Self
pub fn with_options(self, options: GenerationConfigOpts<'a>) -> Self
Replace the options with the new options
Builder
pub fn table(&self, name: &str) -> TableOptions<'_>
pub fn get_schema_path(&self) -> &str
pub fn get_model_path(&self) -> &str
pub fn get_once_common_structs(&self) -> bool
pub fn get_once_connection_type(&self) -> bool
pub fn get_default_table_options(&self) -> &TableOptions<'_>
Sourcepub fn any_once_option(&self) -> bool
pub fn any_once_option(&self) -> bool
Get if any of the “once-*” options is active / if the common-file is active
Trait Implementations§
Source§impl<'a> Clone for GenerationConfig<'a>
impl<'a> Clone for GenerationConfig<'a>
Source§fn clone(&self) -> GenerationConfig<'a>
fn clone(&self) -> GenerationConfig<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for GenerationConfig<'a>
impl<'a> RefUnwindSafe for GenerationConfig<'a>
impl<'a> Send for GenerationConfig<'a>
impl<'a> Sync for GenerationConfig<'a>
impl<'a> Unpin for GenerationConfig<'a>
impl<'a> UnwindSafe for GenerationConfig<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more