Skip to main content

unitycatalog_server/codegen/tables/
handler.rs

1// @generated — do not edit by hand.
2//! Handler trait for [`TableHandler`].
3//!
4//! Implement this trait to provide a custom backend for this service, then mount the
5//! generated handler functions (in the sibling `server` module) onto an `axum::Router`
6//! with your implementation as state.
7//!
8//! # Composability
9//!
10//! A single struct can implement multiple handler traits to serve multiple
11//! services. Use [`axum::Router::merge`] to compose per-service routers together.
12//!
13//! Service for managing tables in Unity Catalog.
14//! Tables represent structured data stored in a schema, supporting managed and external storage formats.
15use crate::Result;
16use async_trait::async_trait;
17use unitycatalog_common::models::tables::v1::*;
18#[async_trait]
19pub trait TableHandler<Cx = crate::api::RequestContext>: Send + Sync + 'static {
20    /// Gets an array of summaries for tables for a schema and catalog within the metastore. The table summaries returned are either:
21    /// - summaries for tables (within the current metastore and parent catalog and schema), when the user is a metastore admin, or:
22    /// - summaries for tables and schemas (within the current metastore and parent catalog) for which the user has ownership or the
23    /// SELECT privilege on the table and ownership or USE_SCHEMA privilege on the schema, provided that the user also has ownership
24    /// or the USE_CATALOG privilege on the parent catalog.
25    ///
26    /// There is no guarantee of a specific ordering of the elements in the array.
27    async fn list_table_summaries(
28        &self,
29        request: ListTableSummariesRequest,
30        context: Cx,
31    ) -> Result<ListTableSummariesResponse>;
32    /// Gets an array of all tables for the current metastore under the parent catalog and schema.
33    ///
34    /// The caller must be a metastore admin or an owner of (or have the SELECT privilege on) the table.
35    /// For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the
36    /// parent catalog and the USE_SCHEMA privilege on the parent schema. There is no guarantee of a
37    /// specific ordering of the elements in the array.
38    async fn list_tables(
39        &self,
40        request: ListTablesRequest,
41        context: Cx,
42    ) -> Result<ListTablesResponse>;
43    /// Create a table
44    async fn create_table(&self, request: CreateTableRequest, context: Cx) -> Result<Table>;
45    /// Get a table
46    async fn get_table(&self, request: GetTableRequest, context: Cx) -> Result<Table>;
47    /// Get boolean reflecting if table exists
48    async fn get_table_exists(
49        &self,
50        request: GetTableExistsRequest,
51        context: Cx,
52    ) -> Result<GetTableExistsResponse>;
53    /// Delete a table
54    async fn delete_table(&self, request: DeleteTableRequest, context: Cx) -> Result<()>;
55}