Skip to main content

SequenceBuilder

Struct SequenceBuilder 

Source
pub struct SequenceBuilder { /* private fields */ }
Expand description

Builder for constructing database sequences

Implementations§

Source§

impl SequenceBuilder

Source

pub fn new() -> Self

Create a new sequence builder

Source

pub fn name(self, name: impl Into<String>) -> Self

Set the sequence name

Source

pub fn set_name(&mut self, name: impl Into<String>)

Set the sequence name (mutable reference version for conditional building)

Source

pub fn in_schema(self, schema: impl Into<String>) -> Self

Set the schema name

Source

pub fn set_schema(&mut self, schema: impl Into<String>)

Set the schema name (mutable reference version for conditional building)

Source

pub fn data_type(self, data_type: impl Into<String>) -> Self

Set the data type

Source

pub fn set_data_type(&mut self, data_type: impl Into<String>)

Set the data type (mutable reference version for conditional building)

Source

pub fn start_value(self, start: i64) -> Self

Set the start value

Source

pub fn set_start_value(&mut self, start: i64)

Set the start value (mutable reference version for conditional building)

Source

pub fn minimum_value(self, min: i64) -> Self

Set the minimum value

Source

pub fn set_minimum_value(&mut self, min: i64)

Set the minimum value (mutable reference version for conditional building)

Source

pub fn maximum_value(self, max: i64) -> Self

Set the maximum value

Source

pub fn set_maximum_value(&mut self, max: i64)

Set the maximum value (mutable reference version for conditional building)

Source

pub fn increment(self, increment: i64) -> Self

Set the increment

Source

pub fn set_increment(&mut self, increment: i64)

Set the increment (mutable reference version for conditional building)

Source

pub fn cycle(self, cycle: bool) -> Self

Set the cycle behavior

Source

pub fn set_cycle(&mut self, cycle: bool)

Set the cycle behavior (mutable reference version for conditional building)

Source

pub fn cache(self, cache: i64) -> Self

Set the cache size

Source

pub fn set_cache(&mut self, cache: i64)

Set the cache size (mutable reference version for conditional building)

Source

pub fn owner(self, owner: impl Into<String>) -> Self

Set the owner

Source

pub fn set_owner(&mut self, owner: impl Into<String>)

Set the owner (mutable reference version for conditional building)

Source

pub fn comment(self, comment: impl Into<String>) -> Self

Set a comment on the sequence

Source

pub fn set_comment(&mut self, comment: impl Into<String>)

Set a comment on the sequence (mutable reference version for conditional building)

Source

pub fn simple() -> Self

Create a simple sequence

Source

pub fn auto_increment() -> Self

Create an auto-increment sequence

Source

pub fn small_auto_increment() -> Self

Create a small auto-increment sequence

Source

pub fn large_auto_increment() -> Self

Create a large auto-increment sequence

Source

pub fn timestamp() -> Self

Create a timestamp sequence

Source

pub fn counter() -> Self

Create a counter sequence

Source

pub fn cycling() -> Self

Create a cycling sequence

Source

pub fn cached() -> Self

Create a cached sequence

Source

pub fn get_name(&self) -> Option<&str>

Get the sequence name

Source

pub fn get_schema(&self) -> Option<&str>

Get the schema name

Source

pub fn get_data_type(&self) -> Option<&str>

Get the data type

Source

pub fn get_start_value(&self) -> Option<i64>

Get the start value

Source

pub fn get_minimum_value(&self) -> Option<i64>

Get the minimum value

Source

pub fn get_maximum_value(&self) -> Option<i64>

Get the maximum value

Source

pub fn get_increment(&self) -> Option<i64>

Get the increment

Source

pub fn get_cycle(&self) -> Option<bool>

Get the cycle behavior

Source

pub fn get_cache(&self) -> Option<i64>

Get the cache size

Source

pub fn get_owner(&self) -> Option<&str>

Get the owner

Source

pub fn get_comment(&self) -> Option<&str>

Get the comment

Source

pub fn has_name(&self) -> bool

Check if the sequence has a name

Source

pub fn has_schema(&self) -> bool

Check if the sequence has a schema

Source

pub fn has_data_type(&self) -> bool

Check if the sequence has a data type

Source

pub fn has_start_value(&self) -> bool

Check if the sequence has a start value

Source

pub fn has_minimum_value(&self) -> bool

Check if the sequence has a minimum value

Source

pub fn has_maximum_value(&self) -> bool

Check if the sequence has a maximum value

Source

pub fn has_increment(&self) -> bool

Check if the sequence has an increment

Source

pub fn has_cycle(&self) -> bool

Check if the sequence has cycle behavior set

Source

pub fn has_cache(&self) -> bool

Check if the sequence has a cache size

Source

pub fn has_owner(&self) -> bool

Check if the sequence has an owner

Source

pub fn has_comment(&self) -> bool

Check if the sequence has a comment

Trait Implementations§

Source§

impl Clone for SequenceBuilder

Source§

fn clone(&self) -> SequenceBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConditionalBuilder for SequenceBuilder

Source§

fn when<F>(self, condition: bool, config_fn: F) -> Self
where F: FnOnce(&mut Self), Self: Sized,

Apply configuration conditionally Read more
Source§

fn when_else<F, G>(self, condition: bool, if_true: F, if_false: G) -> Self
where F: FnOnce(&mut Self), G: FnOnce(&mut Self), Self: Sized,

Apply configuration conditionally with a default fallback Read more
Source§

impl Debug for SequenceBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl InspectableBuilder for SequenceBuilder

Source§

fn debug_info(&self) -> String

Get a debug representation of the current builder state Read more
Source§

fn summary(&self) -> String

Get a summary of the current configuration Read more
Source§

impl SchemaBuilder for SequenceBuilder

Source§

type Output = Sequence

The type of schema object that this builder produces
Source§

type Error = SequenceBuildError

The type of error that can occur during building
Source§

fn build(self) -> Result<Self::Output, Self::Error>

Build the final schema object from the builder configuration Read more
Source§

impl ValidatableBuilder for SequenceBuilder

Source§

fn is_valid(&self) -> bool

Check if the current builder configuration is valid Read more
Source§

fn validation_errors(&self) -> Vec<String>

Get a list of validation errors for the current configuration Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more