Skip to main content

DbCatalog

Trait DbCatalog 

Source
pub trait DbCatalog:
    Send
    + Sync
    + 'static {
    // Required methods
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn db<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Db, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Supplies the databases the server exposes.

Implementations are expected to open databases lazily and cache them so a database is shared across all client connections. db returns a fresh immutable snapshot each call, the same way the corium sql shell captures a current Db per statement.

Required Methods§

Source

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Names of the databases clients may connect to.

§Errors

Returns CatalogError when the catalog cannot be enumerated.

Source

fn db<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Db, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

A current snapshot of the database named name.

§Errors

Returns CatalogError::NotFound when the database is unknown or not permitted, and CatalogError::Unavailable when it cannot be opened.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§