pub struct CustomSqlBuilder { /* private fields */ }Expand description
Builder for constructing custom SQL migrations
Implementations§
Source§impl CustomSqlBuilder
impl CustomSqlBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set a description for the migration
Add multiple tags to the migration
Sourcepub fn requires_manual_review(self) -> Self
pub fn requires_manual_review(self) -> Self
Mark the migration as requiring manual review
Sourcepub fn destructive(self) -> Self
pub fn destructive(self) -> Self
Mark the migration as destructive (will cause data loss)
Sourcepub fn non_destructive(self) -> Self
pub fn non_destructive(self) -> Self
Mark the migration as non-destructive
Sourcepub fn depends_on(self, migration_id: impl Into<String>) -> Self
pub fn depends_on(self, migration_id: impl Into<String>) -> Self
Add a dependency on another migration
Sourcepub fn dependencies(
self,
deps: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn dependencies( self, deps: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add multiple dependencies
Sourcepub fn rollback_safe(self) -> Self
pub fn rollback_safe(self) -> Self
Mark the migration as rollback-safe
Sourcepub fn not_rollback_safe(self) -> Self
pub fn not_rollback_safe(self) -> Self
Mark the migration as not rollback-safe
Sourcepub fn data_migration(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn data_migration(id: impl Into<String>, name: impl Into<String>) -> Self
Convenience method for creating a data migration
Sourcepub fn schema_patch(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn schema_patch(id: impl Into<String>, name: impl Into<String>) -> Self
Convenience method for creating a schema patch
Sourcepub fn destructive_migration(
id: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn destructive_migration( id: impl Into<String>, name: impl Into<String>, ) -> Self
Convenience method for creating a destructive migration
Sourcepub fn performance_optimization(
id: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn performance_optimization( id: impl Into<String>, name: impl Into<String>, ) -> Self
Convenience method for creating a performance optimization
Sourcepub fn security_patch(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn security_patch(id: impl Into<String>, name: impl Into<String>) -> Self
Convenience method for creating a security patch
Sourcepub fn get_up_sql(&self) -> Option<&String>
pub fn get_up_sql(&self) -> Option<&String>
Get the up SQL
Sourcepub fn get_down_sql(&self) -> Option<&String>
pub fn get_down_sql(&self) -> Option<&String>
Get the down SQL
Sourcepub fn is_destructive(&self) -> bool
pub fn is_destructive(&self) -> bool
Check if the migration is destructive
Sourcepub fn is_manual_review_required(&self) -> bool
pub fn is_manual_review_required(&self) -> bool
Check if the migration requires manual review
Sourcepub fn is_rollback_safe(&self) -> bool
pub fn is_rollback_safe(&self) -> bool
Check if the migration is rollback-safe
Get all tags
Sourcepub fn get_dependencies(&self) -> &[String]
pub fn get_dependencies(&self) -> &[String]
Get all dependencies
Trait Implementations§
Source§impl Clone for CustomSqlBuilder
impl Clone for CustomSqlBuilder
Source§fn clone(&self) -> CustomSqlBuilder
fn clone(&self) -> CustomSqlBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConditionalBuilder for CustomSqlBuilder
impl ConditionalBuilder for CustomSqlBuilder
Source§impl Debug for CustomSqlBuilder
impl Debug for CustomSqlBuilder
Source§impl SchemaBuilder for CustomSqlBuilder
impl SchemaBuilder for CustomSqlBuilder
Auto Trait Implementations§
impl Freeze for CustomSqlBuilder
impl RefUnwindSafe for CustomSqlBuilder
impl Send for CustomSqlBuilder
impl Sync for CustomSqlBuilder
impl Unpin for CustomSqlBuilder
impl UnsafeUnpin for CustomSqlBuilder
impl UnwindSafe for CustomSqlBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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