Thalweg · API reference ← Main docs

TableCatalog

Trait TableCatalog 

Source
pub trait TableCatalog: Send + Sync {
    // Required methods
    fn describe<'life0, 'life1, 'async_trait>(
        &'life0 self,
        table: &'life1 TableRef,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TableState>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn reconcile<'life0, 'life1, 'async_trait>(
        &'life0 self,
        desired: &'life1 DesiredTable,
        opts: ReconcileOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ReconcileOutcome, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn register_sink<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        table: &'life1 TableRef,
        sink: &'life2 SinkId,
    ) -> Pin<Box<dyn Future<Output = Result<(), CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn vend_credentials<'life0, 'life1, 'async_trait>(
        &'life0 self,
        table: &'life1 TableRef,
        access: Access,
    ) -> Pin<Box<dyn Future<Output = Result<VendedCredentials, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Table provisioning, evolution, credential vending, and sink registration.

A backend implements every method; the trait is the isolation boundary that keeps sinks backend-agnostic.

Required Methods§

Source

fn describe<'life0, 'life1, 'async_trait>( &'life0 self, table: &'life1 TableRef, ) -> Pin<Box<dyn Future<Output = Result<Option<TableState>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the live state of table, or None if it does not exist.

§Errors

Returns CatalogError::Backend if the catalog cannot be reached or the response cannot be interpreted.

Source

fn reconcile<'life0, 'life1, 'async_trait>( &'life0 self, desired: &'life1 DesiredTable, opts: ReconcileOptions, ) -> Pin<Box<dyn Future<Output = Result<ReconcileOutcome, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reconcile table toward desired: describe it, compute a plan with crate::reconcile::plan, and execute the plan. Idempotent — a steady-state redeploy is a no-op.

§Errors

Returns CatalogError::Refused if the plan carries any refusal (the caller must surface this loudly, never degrade silently), or CatalogError::Backend on an execution failure.

Source

fn register_sink<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, table: &'life1 TableRef, sink: &'life2 SinkId, ) -> Pin<Box<dyn Future<Output = Result<(), CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Register sink as a writer of table for ownership/coverage bookkeeping.

§Errors

Returns CatalogError::Backend on a backend failure, or CatalogError::NotFound if the table does not exist.

Source

fn vend_credentials<'life0, 'life1, 'async_trait>( &'life0 self, table: &'life1 TableRef, access: Access, ) -> Pin<Box<dyn Future<Output = Result<VendedCredentials, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Vend temporary, scoped credentials granting access to table, inheriting the caller’s privileges. Serves both the write path and the Iceberg recovery read path.

§Errors

Returns CatalogError::Backend if credentials cannot be minted, or CatalogError::NotFound if the table does not exist.

Implementors§