postgresql_commands::pg_basebackup

Struct PgBaseBackupBuilder

Source
pub struct PgBaseBackupBuilder { /* private fields */ }
Expand description

pg_basebackup takes a base backup of a running PostgreSQL server.

Implementations§

Source§

impl PgBaseBackupBuilder

Source

pub fn new() -> Self

Create a new PgBaseBackupBuilder

Source

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

Create a new PgBaseBackupBuilder from Settings

Source

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

Location of the program binary

Source

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

receive base backup into directory

Source

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

output format (plain (default), tar)

Source

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

maximum transfer rate to transfer data directory (in kB/s, or use suffix “k” or “M”)

Source

pub fn write_recovery_conf(self) -> Self

write configuration for replication

Source

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

backup target (if other than client)

Source

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

relocate tablespace in OLDDIR to NEWDIR

Source

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

location for the write-ahead log directory

Source

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

include required WAL files with specified method

Source

pub fn gzip(self) -> Self

compress tar output

Source

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

compress on client or server as specified

Source

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

set fast or spread checkpointing

Source

pub fn create_slot(self) -> Self

create replication slot

Source

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

set backup label

Source

pub fn no_clean(self) -> Self

do not clean up after errors

Source

pub fn no_sync(self) -> Self

do not wait for changes to be written safely to disk

Source

pub fn progress(self) -> Self

show progress information

Source

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

replication slot to use

Source

pub fn verbose(self) -> Self

output verbose messages

Source

pub fn version(self) -> Self

output version information, then exit

Source

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

use algorithm for manifest checksums

Source

pub fn manifest_force_encode(self) -> Self

hex encode all file names in manifest

Source

pub fn no_estimate_size(self) -> Self

do not estimate backup size in server side

Source

pub fn no_manifest(self) -> Self

suppress generation of backup manifest

Source

pub fn no_slot(self) -> Self

prevent creation of temporary replication slot

Source

pub fn no_verify_checksums(self) -> Self

do not verify checksums

Source

pub fn help(self) -> Self

show this help, then exit

Source

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

connection string

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 number

Source

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

time between status packets sent to server (in seconds)

Source

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

connect as specified database user

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

Trait Implementations§

Source§

impl Clone for PgBaseBackupBuilder

Source§

fn clone(&self) -> PgBaseBackupBuilder

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 PgBaseBackupBuilder

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 PgBaseBackupBuilder

Source§

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

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

impl Default for PgBaseBackupBuilder

Source§

fn default() -> PgBaseBackupBuilder

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§

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,

Source§

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>,

Source§

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>,

Source§

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