pub struct PostgresClient { /* private fields */ }Expand description
One namespace’s Postgres databases. See Client::postgres.
Every method answers crate::Error::Conflict when the postgres
plugin is not installed in the namespace (or is switched off for the
fleet); the error’s message says which, and how to fix it.
Implementations§
Source§impl PostgresClient
impl PostgresClient
pub fn namespace(&self) -> &str
Sourcepub async fn databases(&self) -> Result<PostgresDatabases>
pub async fn databases(&self) -> Result<PostgresDatabases>
The namespace’s databases, and where they are reached. Never carries a password.
Sourcepub async fn create_database(
&self,
new: &NewDatabase,
) -> Result<CreatedPostgresDatabase>
pub async fn create_database( &self, new: &NewDatabase, ) -> Result<CreatedPostgresDatabase>
Create a database with its own role and password. Needs admin in
the namespace.
The password comes back this once. A name the namespace already
uses, a pg-<name> secret that already exists, or a namespace at the
host’s limit is a crate::Error::Conflict.
Sourcepub async fn delete_database(
&self,
name: &str,
) -> Result<DeletedPostgresDatabase>
pub async fn delete_database( &self, name: &str, ) -> Result<DeletedPostgresDatabase>
Revoke a database’s credential and forget it. Needs admin in the
namespace. Its data stays on pg-fc until an operator purges it, and
its pg-<name> secret is left in place.
Trait Implementations§
Source§impl Clone for PostgresClient
impl Clone for PostgresClient
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresClient
impl !UnwindSafe for PostgresClient
impl Freeze for PostgresClient
impl Send for PostgresClient
impl Sync for PostgresClient
impl Unpin for PostgresClient
impl UnsafeUnpin for PostgresClient
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