Struct postgresql_commands::pg_dump::PgDumpBuilder

source ·
pub struct PgDumpBuilder { /* private fields */ }
Expand description

pg_dump dumps a database as a text file or to other formats.

Implementations§

source§

impl PgDumpBuilder

source

pub fn new() -> Self

Create a new PgDumpBuilder

source

pub fn from(settings: &dyn Settings) -> Self

Create a new PgDumpBuilder from Settings

source

pub fn program_dir<P: Into<PathBuf>>(self, path: P) -> Self

Location of the program binary

source

pub fn data_only(self) -> Self

Dump only the data, not the schema

source

pub fn large_objects(self) -> Self

Dump large objects in binary format

source

pub fn no_large_objects(self) -> Self

Do not dump large objects

source

pub fn clean(self) -> Self

Output commands to clean (drop) database objects prior to outputting the commands for creating them

source

pub fn create(self) -> Self

Output commands to create the database objects (data definition)

source

pub fn extension<S: AsRef<OsStr>>(self, extension: S) -> Self

Dump data for the named extension

source

pub fn encoding<S: AsRef<OsStr>>(self, encoding: S) -> Self

Dump data in encoding ENCODING

source

pub fn file<S: AsRef<OsStr>>(self, file: S) -> Self

Set the output file or directory name

source

pub fn format<S: AsRef<OsStr>>(self, format: S) -> Self

Set the output file format (custom, directory, tar, plain text (default))

source

pub fn jobs<S: AsRef<OsStr>>(self, jobs: S) -> Self

Use this many parallel jobs to dump

source

pub fn schema<S: AsRef<OsStr>>(self, schema: S) -> Self

Dump data for the named schema(s) only

source

pub fn exclude_schema<S: AsRef<OsStr>>(self, exclude_schema: S) -> Self

Do not output commands to set ownership of objects to match the original database

source

pub fn no_owner(self) -> Self

Do not output commands to set ownership of objects to match the original database

source

pub fn no_reconnect(self) -> Self

Do not reconnect to the database

source

pub fn schema_only(self) -> Self

Dump only the schema, no data

source

pub fn superuser<S: AsRef<OsStr>>(self, superuser: S) -> Self

Dump data as a superuser

source

pub fn table<S: AsRef<OsStr>>(self, table: S) -> Self

Dump data for the named table(s) only

source

pub fn exclude_table<S: AsRef<OsStr>>(self, exclude_table: S) -> Self

Do not output commands to create the table(s) containing the data

source

pub fn verbose(self) -> Self

Enable verbose mode

source

pub fn version(self) -> Self

Output version information, then exit

source

pub fn no_privileges(self) -> Self

Do not output commands to set object privileges

source

pub fn compression<S: AsRef<OsStr>>(self, compress: S) -> Self

Set the compression level to use

source

pub fn binary_upgrade(self) -> Self

Dump data in a format suitable for binary upgrade

source

pub fn column_inserts(self) -> Self

Dump data as INSERT commands with column names

source

pub fn attribute_inserts(self) -> Self

Dump data as INSERT commands with column names

source

pub fn disable_dollar_quoting(self) -> Self

Disable dollar quoting, use SQL standard quoting

source

pub fn disable_triggers(self) -> Self

Disable triggers during data-only restore

source

pub fn enable_row_security(self) -> Self

Dump data with row security enabled

source

pub fn exclude_table_data_and_children<S: AsRef<OsStr>>( self, exclude_table_data_and_children: S, ) -> Self

Dump data for the named table(s) but exclude data for their child tables

source

pub fn extra_float_digits<S: AsRef<OsStr>>(self, extra_float_digits: S) -> Self

Set the number of digits displayed for floating-point values

source

pub fn if_exists(self) -> Self

Use IF EXISTS when dropping objects

source

pub fn include_foreign_data<S: AsRef<OsStr>>( self, include_foreign_data: S, ) -> Self

Include foreign-data wrappers in the dump

source

pub fn inserts(self) -> Self

Dump data as INSERT commands

source

pub fn load_via_partition_root(self) -> Self

Load data via the partition root table

source

pub fn lock_wait_timeout(self, lock_wait_timeout: u16) -> Self

Fail after waiting TIMEOUT for a table lock

source

pub fn no_comments(self) -> Self

Do not output comments

source

pub fn no_publications(self) -> Self

Do not output publications

source

pub fn no_security_labels(self) -> Self

Do not output security labels

source

pub fn no_subscriptions(self) -> Self

Do not output subscriptions

source

pub fn no_table_access_method(self) -> Self

Do not output table access method

source

pub fn no_tablespaces(self) -> Self

Do not output tablespace assignments

source

pub fn no_toast_compression(self) -> Self

Do not output TOAST table compression

source

pub fn no_unlogged_table_data(self) -> Self

Do not output unlogged table data

source

pub fn on_conflict_do_nothing(self) -> Self

Use ON CONFLICT DO NOTHING for INSERTs

source

pub fn quote_all_identifiers(self) -> Self

Quote all identifiers, even if not key words

source

pub fn rows_per_insert(self, rows_per_insert: u64) -> Self

Set the number of rows per INSERT

source

pub fn section<S: AsRef<OsStr>>(self, section: S) -> Self

Dump data for the named section(s) only

source

pub fn serializable_deferrable(self) -> Self

Dump data as a serializable transaction

source

pub fn snapshot<S: AsRef<OsStr>>(self, snapshot: S) -> Self

Use a snapshot with the specified name

source

pub fn strict_names(self) -> Self

Use strict SQL identifier syntax

source

pub fn table_and_children<S: AsRef<OsStr>>(self, table_and_children: S) -> Self

Dump data for the named table(s) and their children

source

pub fn use_set_session_authorization(self) -> Self

Use SET SESSION AUTHORIZATION commands instead of ALTER OWNER

source

pub fn help(self) -> Self

Show help, then exit

source

pub fn dbname<S: AsRef<OsStr>>(self, dbname: S) -> Self

database to connect to

source

pub fn host<S: AsRef<OsStr>>(self, host: S) -> Self

database server host or socket directory

source

pub fn port(self, port: u16) -> Self

database server port

source

pub fn username<S: AsRef<OsStr>>(self, username: S) -> Self

database user name

source

pub fn no_password(self) -> Self

never prompt for password

source

pub fn password(self) -> Self

force password prompt (should happen automatically)

source

pub fn pg_password<S: AsRef<OsStr>>(self, pg_password: S) -> Self

user password

source

pub fn role<S: AsRef<OsStr>>(self, rolename: S) -> Self

Specifies a role name to be used to create the dump

Trait Implementations§

source§

impl Clone for PgDumpBuilder

source§

fn clone(&self) -> PgDumpBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CommandBuilder for PgDumpBuilder

source§

fn get_program(&self) -> &'static OsStr

Get the program name

source§

fn get_program_dir(&self) -> &Option<PathBuf>

Location of the program binary

source§

fn get_args(&self) -> Vec<OsString>

Get the arguments for the command

source§

fn get_envs(&self) -> Vec<(OsString, OsString)>

Get the environment variables for the command

source§

fn env<S: AsRef<OsStr>>(self, key: S, value: S) -> Self

Set an environment variable for the command

source§

fn get_program_file(&self) -> PathBuf

Fully qualified path to the program binary
source§

fn build(self) -> Command
where Self: Sized,

Build a standard Command
source§

impl Debug for PgDumpBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for PgDumpBuilder

source§

fn default() -> PgDumpBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more