pub struct GenerationConfig<'a> {
pub table_options: HashMap<&'a str, TableOptions<'a>>,
pub default_table_options: TableOptions<'a>,
pub connection_type: String,
pub schema_path: String,
pub model_path: String,
pub once_common_structs: bool,
pub single_model_file: bool,
pub file_mode: FileMode,
pub read_only_prefix: Option<Vec<String>>,
pub once_connection: bool,
pub lessen_conflicts: bool,
}Fields§
§table_options: HashMap<&'a str, TableOptions<'a>>Specific Table options for a given table
default_table_options: TableOptions<'a>Default table options, used when not in table_options
connection_type: StringConnection type to insert Example: “diesel::SqliteConnection”
schema_path: Stringdiesel schema path to use Example: “crate::schema::”
model_path: Stringmodel path to use Example: “crate::models::”
once_common_structs: boolOnly generate common structs once and put them in a common file
single_model_file: boolOnly generate a single model file instead of a folder with a “mod.rs” and a “generated.rs”
file_mode: FileModeSet which filemode to use
read_only_prefix: Option<Vec<String>>A prefix of read-only tables
once_connection: boolOnly generate the “Connection” type once
lessen_conflicts: boolLessen conflicts with diesel types
Implementations§
Source§impl GenerationConfig<'_>
impl GenerationConfig<'_>
pub fn table(&self, name: &str) -> TableOptions<'_>
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