pub struct PostgresShareReader { /* private fields */ }
Expand description

ShareReader implementation leveraging Postgres as backing store.

Implementations§

source§

impl PostgresShareReader

source

pub async fn new(connection_url: &str) -> Self

Create a new PostgresShareReader.

source

pub fn from_pool(pool: PgPool) -> Self

Create a new PostgresShareReader from an existing PgPool.

source

pub fn pool(&self) -> &PgPool

Return a reference to the underlying PgPool.

source

pub async fn insert_share(&self, share_name: &str) -> Result<Share, Error>

Insert a new share into the database.

source

pub async fn delete_share_by_name(&self, share_name: &str) -> Result<(), Error>

Delete a share from the database.

source

pub async fn delete_shares(&self) -> Result<(), Error>

Delete all shares from the database.

source

pub async fn insert_schema( &self, share: &Share, schema_name: &str ) -> Result<Schema, Error>

Insert a new schema into the database.

source

pub async fn delete_schema_by_name( &self, schema_name: &str ) -> Result<(), Error>

Delete a schema from the database.

source

pub async fn delete_schemas(&self) -> Result<(), Error>

Delete all schemas from the database.

source

pub async fn insert_table( &self, schema: &Schema, table_name: &str, storage_path: &str, storage_format: Option<&String> ) -> Result<Table, Error>

Insert a new table into the database.

source

pub async fn delete_table_by_name( &self, share_name: &str, schema_name: &str, table_name: &str ) -> Result<(), Error>

Delete a table from the database.

source

pub async fn delete_tables(&self) -> Result<(), Error>

Delete all tables from the database.

Trait Implementations§

source§

impl Debug for PostgresShareReader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ShareReader for PostgresShareReader

source§

fn list_shares<'life0, 'life1, 'async_trait>( &'life0 self, cursor: &'life1 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Share>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a list of shares stored on the sharing server store. The list cursor is used to limit the amount of returned shares and to resume listing from a specified point in the collection.
source§

fn get_share<'life0, 'life1, 'async_trait>( &'life0 self, share_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Share, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get share details by name
source§

fn list_schemas<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, share_name: &'life1 str, cursor: &'life2 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Schema>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a list of schemas stored on the sharing server store under a spcific share. The list cursor is used to limit the amount of returned schemas and to resume listing from a specified point in the collection.
source§

fn list_tables_in_share<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, share_name: &'life1 str, cursor: &'life2 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Table>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a list of tables stored on the sharing server store under a spcific share combination. The list cursor is used to limit the amount of returned tables and to resume listing from a specified point in the collection.
source§

fn list_tables_in_schema<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, share_name: &'life1 str, schema_name: &'life2 str, cursor: &'life3 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Table>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Fetch a list of tables stored on the sharing server store under a spcific share + schema combination. The list cursor is used to limit the amount of returned tables and to resume listing from a specified point in the collection.
source§

fn get_table<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, share_name: &'life1 str, schema_name: &'life2 str, table_name: &'life3 str ) -> Pin<Box<dyn Future<Output = Result<Table, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Get table specifics for a combination of share + schema + name.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more