pub struct Config {Show 15 fields
pub dialect: Dialect,
pub url: Option<String>,
pub out: Option<String>,
pub schema: String,
pub no_back_referencing: bool,
pub only: Vec<String>,
pub except: Vec<String>,
pub output: Output,
pub hooks: Hooks,
pub inflections: BTreeMap<String, String>,
pub tables: BTreeMap<String, TableConfig>,
pub aliases: BTreeMap<String, TableAliases>,
pub relationships: Vec<ManualRelationship>,
pub types: Types,
pub queries: Option<QueriesConfig>,
}Expand description
The whole configuration file.
Fields§
§dialect: DialectThe dialect to introspect and emit for.
url: Option<String>The connection string (sqlite://path or a plain path;
postgres://…). Schema provenance is the user’s migration flow’s
business — the generator reads whatever the connection sees.
out: Option<String>The directory the generated files land in.
schema: StringPostgreSQL: the namespace to introspect (bob’s shared_schema).
no_back_referencing: boolEmit no has-many back-references anywhere.
only: Vec<String>When non-empty, only these tables are generated.
except: Vec<String>These tables are skipped.
output: OutputOutput options.
hooks: HooksWhere the application’s hand-written hook functions live.
inflections: BTreeMap<String, String>Irregular plural → singular (people = "person").
tables: BTreeMap<String, TableConfig>Per-table options, keyed by table name.
aliases: BTreeMap<String, TableAliases>Renames, keyed by table name.
relationships: Vec<ManualRelationship>Manual relationships for keys the schema does not declare.
types: TypesThe user-overridable type map.
queries: Option<QueriesConfig>Hand-written SQL → typed code (Layer 4). Absent means no query files
are generated from; see crate::queries.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more