Struct postgresql_commands::psql::PsqlBuilder
source · pub struct PsqlBuilder { /* private fields */ }
Expand description
psql is the PostgreSQL interactive terminal.
Implementations§
source§impl PsqlBuilder
impl PsqlBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new PsqlBuilder
sourcepub fn from(settings: &dyn Settings) -> Self
pub fn from(settings: &dyn Settings) -> Self
Create a new PsqlBuilder from Settings
sourcepub fn program_dir<P: Into<PathBuf>>(self, path: P) -> Self
pub fn program_dir<P: Into<PathBuf>>(self, path: P) -> Self
Location of the program binary
sourcepub fn command<S: AsRef<OsStr>>(self, command: S) -> Self
pub fn command<S: AsRef<OsStr>>(self, command: S) -> Self
run only single command (SQL or internal) and exit
sourcepub fn variable<S: AsRef<OsStr>>(self, variable: (S, S)) -> Self
pub fn variable<S: AsRef<OsStr>>(self, variable: (S, S)) -> Self
set psql variable NAME to VALUE (e.g., -v ON_ERROR_STOP=1)
sourcepub fn single_transaction(self) -> Self
pub fn single_transaction(self) -> Self
execute as a single transaction (if non-interactive)
sourcepub fn help<S: AsRef<OsStr>>(self, help: S) -> Self
pub fn help<S: AsRef<OsStr>>(self, help: S) -> Self
show help, then exit Possible values: [options, commands, variables]
sourcepub fn echo_errors(self) -> Self
pub fn echo_errors(self) -> Self
echo failed commands
sourcepub fn echo_queries(self) -> Self
pub fn echo_queries(self) -> Self
echo commands sent to server
display queries that internal commands generate
sourcepub fn no_readline(self) -> Self
pub fn no_readline(self) -> Self
disable enhanced command line editing (readline)
sourcepub fn single_step(self) -> Self
pub fn single_step(self) -> Self
single-step mode (confirm each query)
sourcepub fn single_line(self) -> Self
pub fn single_line(self) -> Self
single-line mode (end of line terminates SQL command)
sourcepub fn field_separator<S: AsRef<OsStr>>(self, field_separator: S) -> Self
pub fn field_separator<S: AsRef<OsStr>>(self, field_separator: S) -> Self
field separator for unaligned output (default: “|”)
sourcepub fn pset<S: AsRef<OsStr>>(self, pset: (S, S)) -> Self
pub fn pset<S: AsRef<OsStr>>(self, pset: (S, S)) -> Self
set printing option VAR to ARG (see \pset command)
sourcepub fn record_separator<S: AsRef<OsStr>>(self, record_separator: S) -> Self
pub fn record_separator<S: AsRef<OsStr>>(self, record_separator: S) -> Self
record separator for unaligned output (default: newline)
sourcepub fn tuples_only(self) -> Self
pub fn tuples_only(self) -> Self
print rows only
sourcepub fn table_attr<S: AsRef<OsStr>>(self, table_attr: S) -> Self
pub fn table_attr<S: AsRef<OsStr>>(self, table_attr: S) -> Self
set HTML table tag attributes (e.g., width, border)
sourcepub fn field_separator_zero(self) -> Self
pub fn field_separator_zero(self) -> Self
set field separator for unaligned output to zero byte
sourcepub fn record_separator_zero(self) -> Self
pub fn record_separator_zero(self) -> Self
set record separator for unaligned output to zero byte
sourcepub fn no_password(self) -> Self
pub fn no_password(self) -> Self
never prompt for password
sourcepub fn pg_password<S: AsRef<OsStr>>(self, pg_password: S) -> Self
pub fn pg_password<S: AsRef<OsStr>>(self, pg_password: S) -> Self
user password
Trait Implementations§
source§impl Clone for PsqlBuilder
impl Clone for PsqlBuilder
source§fn clone(&self) -> PsqlBuilder
fn clone(&self) -> PsqlBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CommandBuilder for PsqlBuilder
impl CommandBuilder for PsqlBuilder
source§fn get_program(&self) -> &'static OsStr
fn get_program(&self) -> &'static OsStr
Get the program name
source§fn get_program_dir(&self) -> &Option<PathBuf>
fn get_program_dir(&self) -> &Option<PathBuf>
Location of the program binary