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
Source§fn env<S: AsRef<OsStr>>(self, key: S, value: S) -> Self
fn env<S: AsRef<OsStr>>(self, key: S, value: S) -> Self
Set an environment variable for the command