[][src]Struct sql_db_mapper::Opt

pub struct Opt {
    pub debug: bool,
    pub ugly: bool,
    pub dir: bool,
    pub rust_case: bool,
    pub rustfmt_config: Option<String>,
    pub rustfmt_config_path: Option<String>,
    pub no_functions: bool,
    pub use_tuples: Tuples,
    pub third_party: Vec<ThirdParty>,
    pub conn: String,
    pub output: Option<PathBuf>,
}

The program options for the code generation

Fields

debug: bool

Activate debug mode

ugly: bool

Skip running output through rustfmt

dir: bool

Program will treat output as a directory name rather than a file and generate a whole crate. If output is not provided code is printed as usual

rust_case: bool

Convert names from the database to rust standard (i.e. table names in CamelCase, fields and functions in snake_case)

rustfmt_config: Option<String>

string passed to rustfmt --config

rustfmt_config_path: Option<String>

string passed to rustfmt --config-path

no_functions: bool

Only make mappings for tables and views

use_tuples: Tuples

How to use tuples (used by default for just overloads). Options: overloads (the default, use tuples to represent function overloading). all (Have all functions take a tuple for consitency). none (skip mapping overloaded procs at all). one_overload (avoid tuples by only mapping the oldest sql proc in the database).

third_party: Vec<ThirdParty>

A comma seperated list of third party crates which contain types that will be mapped to and from sql types. Valid values are "bit_vec,chrono,eui48,geo_types,rust_decimal,serde_json,time,uuid"

conn: String

String to connect to database, see tokio_postgres::Config for details. If not provided environment variable DATABASE_URL is checked instead

output: Option<PathBuf>

Output file, stdout if not present

Implementations

impl Opt[src]

pub fn get_cargo_toml(&self) -> String[src]

Produce the Cargo.toml file contents (the dependecies of the generated code)

pub fn get_call_string(&self) -> String[src]

Build a call string that could be used to get the same options

pub fn get_client(&self) -> MyClient[src]

Trait Implementations

impl Debug for Opt[src]

impl StructOpt for Opt[src]

impl StructOptInternal for Opt[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,