pub struct Sequence {
pub name: String,
pub schema: Option<String>,
pub data_type: String,
pub start_value: Option<i64>,
pub minimum_value: Option<i64>,
pub maximum_value: Option<i64>,
pub increment: Option<i64>,
pub cycle: Option<bool>,
pub cache: Option<i64>,
pub owner: Option<String>,
pub comment: Option<String>,
}Expand description
Represents a PostgreSQL sequence
Fields§
§name: String§schema: Option<String>§data_type: String§start_value: Option<i64>§minimum_value: Option<i64>§maximum_value: Option<i64>§increment: Option<i64>§cycle: Option<bool>§cache: Option<i64>§owner: Option<String>§comment: Option<String>Implementations§
Source§impl Sequence
impl Sequence
Sourcepub fn new(name: impl Into<String>, data_type: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, data_type: impl Into<String>) -> Self
Create a new sequence
Sourcepub fn with_schema(self, schema: impl Into<String>) -> Self
pub fn with_schema(self, schema: impl Into<String>) -> Self
Set schema
Sourcepub fn with_start_value(self, start: i64) -> Self
pub fn with_start_value(self, start: i64) -> Self
Set start value
Sourcepub fn with_minimum_value(self, min: i64) -> Self
pub fn with_minimum_value(self, min: i64) -> Self
Set minimum value
Sourcepub fn with_maximum_value(self, max: i64) -> Self
pub fn with_maximum_value(self, max: i64) -> Self
Set maximum value
Sourcepub fn with_increment(self, increment: i64) -> Self
pub fn with_increment(self, increment: i64) -> Self
Set increment
Sourcepub fn with_cycle(self, cycle: bool) -> Self
pub fn with_cycle(self, cycle: bool) -> Self
Set cycle behavior
Sourcepub fn with_cache(self, cache: i64) -> Self
pub fn with_cache(self, cache: i64) -> Self
Set cache size
Sourcepub fn with_owner(self, owner: impl Into<String>) -> Self
pub fn with_owner(self, owner: impl Into<String>) -> Self
Set owner
Sourcepub fn with_comment(self, comment: impl Into<String>) -> Self
pub fn with_comment(self, comment: impl Into<String>) -> Self
Set comment
Sourcepub fn qualified_name(&self) -> String
pub fn qualified_name(&self) -> String
Get the fully qualified sequence name
Sourcepub fn generate_create_ddl(&self) -> String
pub fn generate_create_ddl(&self) -> String
Generate CREATE SEQUENCE DDL
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sequence
impl<'de> Deserialize<'de> for Sequence
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Sequence
Auto Trait Implementations§
impl Freeze for Sequence
impl RefUnwindSafe for Sequence
impl Send for Sequence
impl Sync for Sequence
impl Unpin for Sequence
impl UnsafeUnpin for Sequence
impl UnwindSafe for Sequence
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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