pub struct PostgreSQL { /* private fields */ }Expand description
PostgreSQL server
Implementations§
Source§impl PostgreSQL
PostgreSQL server methods
 
impl PostgreSQL
PostgreSQL server methods
Sourcepub fn new(settings: Settings) -> Self
 
pub fn new(settings: Settings) -> Self
Create a new PostgreSQL instance
Sourcepub async fn setup(&mut self) -> Result<()>
 
pub async fn setup(&mut self) -> Result<()>
Set up the database by extracting the archive and initializing the database. If the installation directory already exists, the archive will not be extracted. If the data directory already exists, the database will not be initialized.
Sourcepub async fn start(&mut self) -> Result<()>
 
pub async fn start(&mut self) -> Result<()>
Start the database and wait for the startup to complete.
If the port is set to 0, the database will be started on a random port.
Sourcepub async fn stop(&self) -> Result<()>
 
pub async fn stop(&self) -> Result<()>
Stop the database gracefully (smart mode) and wait for the shutdown to complete.
Sourcepub async fn create_database<S>(&self, database_name: S) -> Result<()>
 
pub async fn create_database<S>(&self, database_name: S) -> Result<()>
Create a new database with the given name.
Sourcepub async fn database_exists<S>(&self, database_name: S) -> Result<bool>
 
pub async fn database_exists<S>(&self, database_name: S) -> Result<bool>
Check if a database with the given name exists.
Trait Implementations§
Source§impl Clone for PostgreSQL
 
impl Clone for PostgreSQL
Source§fn clone(&self) -> PostgreSQL
 
fn clone(&self) -> PostgreSQL
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for PostgreSQL
 
impl Debug for PostgreSQL
Source§impl Default for PostgreSQL
Default PostgreSQL server
 
impl Default for PostgreSQL
Default PostgreSQL server
Auto Trait Implementations§
impl Freeze for PostgreSQL
impl RefUnwindSafe for PostgreSQL
impl Send for PostgreSQL
impl Sync for PostgreSQL
impl Unpin for PostgreSQL
impl UnwindSafe for PostgreSQL
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more