pub struct SchemaService;Expand description
Schema 服务
Implementations§
Source§impl SchemaService
impl SchemaService
Sourcepub async fn list_schemas(
db: &DatabaseConnection,
) -> Result<Vec<SchemaInfo>, SchemaError>
pub async fn list_schemas( db: &DatabaseConnection, ) -> Result<Vec<SchemaInfo>, SchemaError>
Sourcepub async fn get_schema_info(
db: &DatabaseConnection,
schema_name: &str,
) -> Result<SchemaInfo, SchemaError>
pub async fn get_schema_info( db: &DatabaseConnection, schema_name: &str, ) -> Result<SchemaInfo, SchemaError>
Sourcepub async fn schema_exists(
db: &DatabaseConnection,
schema_name: &str,
) -> Result<bool, SchemaError>
pub async fn schema_exists( db: &DatabaseConnection, schema_name: &str, ) -> Result<bool, SchemaError>
检查 Schema 是否存在
Sourcepub async fn create_schema(
db: &DatabaseConnection,
schema_name: &str,
if_not_exists: bool,
) -> Result<(), SchemaError>
pub async fn create_schema( db: &DatabaseConnection, schema_name: &str, if_not_exists: bool, ) -> Result<(), SchemaError>
创建 Schema(PostgreSQL)
Sourcepub async fn drop_schema(
db: &DatabaseConnection,
schema_name: &str,
if_exists: bool,
cascade: bool,
) -> Result<(), SchemaError>
pub async fn drop_schema( db: &DatabaseConnection, schema_name: &str, if_exists: bool, cascade: bool, ) -> Result<(), SchemaError>
Sourcepub async fn set_schema_comment(
db: &DatabaseConnection,
schema_name: &str,
comment: &str,
) -> Result<(), SchemaError>
pub async fn set_schema_comment( db: &DatabaseConnection, schema_name: &str, comment: &str, ) -> Result<(), SchemaError>
设置 Schema 注释(PostgreSQL)
Auto Trait Implementations§
impl Freeze for SchemaService
impl RefUnwindSafe for SchemaService
impl Send for SchemaService
impl Sync for SchemaService
impl Unpin for SchemaService
impl UnwindSafe for SchemaService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more