pub struct IdentityDef {
pub name: &'static str,
pub schema: Option<&'static str>,
pub type_: IdentityType,
pub increment: Option<&'static str>,
pub min_value: Option<&'static str>,
pub max_value: Option<&'static str>,
pub start_with: Option<&'static str>,
pub cache: Option<i32>,
pub cycle: bool,
}Expand description
The GENERATED ... AS IDENTITY part of a ColumnDef, with the options
of its backing sequence. Numeric options are SQL literals stored as
strings, so they can hold any bigint.
Fields§
§name: &'static strName of the backing sequence
schema: Option<&'static str>Schema of the backing sequence
type_: IdentityTypeALWAYS or BY DEFAULT
increment: Option<&'static str>INCREMENT BY
min_value: Option<&'static str>MINVALUE
max_value: Option<&'static str>MAXVALUE
start_with: Option<&'static str>START WITH
cache: Option<i32>CACHE
cycle: boolCYCLE
Implementations§
Source§impl IdentityDef
impl IdentityDef
Sourcepub const fn new(name: &'static str, type_: IdentityType) -> Self
pub const fn new(name: &'static str, type_: IdentityType) -> Self
Creates an identity backed by the sequence name, with default options.
Sourcepub const fn start_with(self, value: &'static str) -> Self
pub const fn start_with(self, value: &'static str) -> Self
Sets START WITH.
Sourcepub const fn into_identity(self) -> Identity
pub const fn into_identity(self) -> Identity
Converts to the runtime Identity.
Trait Implementations§
Source§impl Clone for IdentityDef
impl Clone for IdentityDef
impl Copy for IdentityDef
Source§impl Debug for IdentityDef
impl Debug for IdentityDef
impl Eq for IdentityDef
Source§impl Hash for IdentityDef
impl Hash for IdentityDef
Source§impl PartialEq for IdentityDef
impl PartialEq for IdentityDef
impl StructuralPartialEq for IdentityDef
Auto Trait Implementations§
impl Freeze for IdentityDef
impl RefUnwindSafe for IdentityDef
impl Send for IdentityDef
impl Sync for IdentityDef
impl Unpin for IdentityDef
impl UnsafeUnpin for IdentityDef
impl UnwindSafe for IdentityDef
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