pub struct MigrationLockOptions { /* private fields */ }Expand description
Stable cross-process migration lock configuration.
Implementations§
Source§impl MigrationLockOptions
impl MigrationLockOptions
Sourcepub fn new(namespace: impl Into<String>) -> Self
pub fn new(namespace: impl Into<String>) -> Self
Creates options using a deterministic PostgreSQL advisory key derived from namespace.
Products migrating from an existing lock implementation should call
Self::with_postgres_advisory_key to preserve the old key during rolling upgrades.
Sourcepub const fn with_postgres_advisory_key(self, key: i64) -> Self
pub const fn with_postgres_advisory_key(self, key: i64) -> Self
Overrides the PostgreSQL advisory key while preserving the shared namespace for MySQL.
Sourcepub const fn with_postgres_transaction(self, enabled: bool) -> Self
pub const fn with_postgres_transaction(self, enabled: bool) -> Self
Controls the PostgreSQL callback transaction (default: true).
Disable for migrators containing CREATE INDEX CONCURRENTLY or independently
committed backfills. The dedicated session still owns the migration lock.
Sourcepub const fn with_mysql_timeout_seconds(self, seconds: u64) -> Self
pub const fn with_mysql_timeout_seconds(self, seconds: u64) -> Self
Overrides the MySQL named-lock wait timeout in whole seconds.
Sourcepub fn namespace(&self) -> &str
pub fn namespace(&self) -> &str
Returns the stable product namespace used for MySQL named locks.
Sourcepub const fn postgres_advisory_key(&self) -> i64
pub const fn postgres_advisory_key(&self) -> i64
Returns the PostgreSQL advisory-lock key.
Sourcepub const fn mysql_timeout_seconds(&self) -> u64
pub const fn mysql_timeout_seconds(&self) -> u64
Returns the MySQL named-lock wait timeout in seconds.
Trait Implementations§
Source§impl Clone for MigrationLockOptions
impl Clone for MigrationLockOptions
Source§fn clone(&self) -> MigrationLockOptions
fn clone(&self) -> MigrationLockOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MigrationLockOptions
impl Debug for MigrationLockOptions
Source§impl PartialEq for MigrationLockOptions
impl PartialEq for MigrationLockOptions
impl Eq for MigrationLockOptions
impl StructuralPartialEq for MigrationLockOptions
Auto Trait Implementations§
impl Freeze for MigrationLockOptions
impl RefUnwindSafe for MigrationLockOptions
impl Send for MigrationLockOptions
impl Sync for MigrationLockOptions
impl Unpin for MigrationLockOptions
impl UnsafeUnpin for MigrationLockOptions
impl UnwindSafe for MigrationLockOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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