pub mod enum_mod;
pub mod sql_commands;
pub mod table;
pub mod view;
pub use enum_mod::enum_get;
pub use enum_mod::list as enum_list;
pub use sql_commands::SqlCommandsRequestBuilder;
pub use table::list as table_list;
pub use table::table_get;
pub use view::views_get;
use crate::PlatformConfig;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct WorkspaceService {
config: Arc<PlatformConfig>,
workspace_id: String,
}
impl WorkspaceService {
pub fn new(config: Arc<PlatformConfig>, workspace_id: impl Into<String>) -> Self {
Self {
config,
workspace_id: workspace_id.into(),
}
}
pub fn table(&self, table_name: impl Into<String>) -> table::TableService {
table::TableService::new(
self.config.as_ref().clone(),
self.workspace_id.clone(),
table_name,
)
}
pub fn view(&self, view_name: impl Into<String>) -> view::ViewService {
view::ViewService::new(
self.config.as_ref().clone(),
self.workspace_id.clone(),
view_name,
)
}
pub fn enum_mod(&self) -> enum_mod::EnumModService {
enum_mod::EnumModService::new(self.config.as_ref().clone(), self.workspace_id.clone())
}
pub fn sql_commands(&self, sql: impl Into<String>) -> sql_commands::SqlCommandsRequestBuilder {
sql_commands::SqlCommandsRequestBuilder::new(
self.config.as_ref().clone(),
self.workspace_id.clone(),
sql,
)
}
}