Struct temp_postgres::TempPostgresBuilder
source · pub struct TempPostgresBuilder { /* private fields */ }
Expand description
Builder for customizing your TempPostgres
object.
After configuring the desired options, run TempPostgresBuilder::spawn()
.
Implementations§
source§impl TempPostgresBuilder
impl TempPostgresBuilder
sourcepub async fn spawn(&self) -> Result<TempPostgres, Error>
pub async fn spawn(&self) -> Result<TempPostgres, Error>
Spawn the postgres server and connect to it.
sourcepub fn clean_on_drop(self, clean_on_drop: bool) -> Self
pub fn clean_on_drop(self, clean_on_drop: bool) -> Self
Enable or disable cleaning of the temporary state directory when the TempPostgres
object is dropped.
This can also be changed after creation with TempPostgres::set_clean_on_drop()
.
sourcepub fn default_locale(self, locale: impl Into<OsString>) -> Self
pub fn default_locale(self, locale: impl Into<OsString>) -> Self
Set the default locale for the database.
This is passed to the pg_ctl
command when initializing the database.
Defaults to “C” if not specified.
sourcepub fn default_timezone(self, timezone: impl Into<OsString>) -> Self
pub fn default_timezone(self, timezone: impl Into<OsString>) -> Self
Set the default timezone for the database.
This is passed to the pg_ctl
command when initializing the database.
Defaults to “UTC” if not specified.
sourcepub fn postgres_command(self, command: impl Into<OsString>) -> Self
pub fn postgres_command(self, command: impl Into<OsString>) -> Self
Overwrite the postgres
command to run.
Can be used to run a postgres
binary from an alternative location.
sourcepub fn pg_ctl_command(self, command: impl Into<OsString>) -> Self
pub fn pg_ctl_command(self, command: impl Into<OsString>) -> Self
Overwrite the pg_ctl
command to run.
Can be used to run a pg_ctl
binary from an alternative location.