pub struct GeneratedValueColumns { /* private fields */ }Expand description
The identity and generated columns of one table, in column order, read once for a statement that writes it. PostgreSQL applies these rules when it rewrites the statement, column by column in table order, before it reads or writes a row, so a statement whose source yields no row is rejected as well.
Implementations§
Source§impl GeneratedValueColumns
impl GeneratedValueColumns
Sourcepub fn of(
catalog: &dyn AssignmentColumnCatalog,
table: &str,
) -> Result<Self, SQLError>
pub fn of( catalog: &dyn AssignmentColumnCatalog, table: &str, ) -> Result<Self, SQLError>
The identity and generated columns of table; none for a relation the catalog does not describe as a table.
Sourcepub fn contains(&self, column: &str) -> bool
pub fn contains(&self, column: &str) -> bool
Whether column is an identity column, whose value OVERRIDING USER VALUE leaves to its sequence.
Sourcepub fn validate_insert<'a>(
&self,
targets: impl IntoIterator<Item = (&'a str, bool)>,
overriding: Option<OverridingKind>,
) -> Result<(), SQLError>
pub fn validate_insert<'a>( &self, targets: impl IntoIterator<Item = (&'a str, bool)>, overriding: Option<OverridingKind>, ) -> Result<(), SQLError>
Reject a value an INSERT supplies for a generated column, and for a GENERATED ALWAYS identity column without an OVERRIDING clause, which a generated column ignores. targets names each target column with whether some row supplies a value other than DEFAULT for it.
Sourcepub fn validate_update<'a>(
&self,
assignments: impl IntoIterator<Item = (&'a str, bool)>,
) -> Result<(), SQLError>
pub fn validate_update<'a>( &self, assignments: impl IntoIterator<Item = (&'a str, bool)>, ) -> Result<(), SQLError>
Reject an assignment other than DEFAULT to a generated column or a GENERATED ALWAYS identity column by an UPDATE, an ON CONFLICT DO UPDATE or a MERGE update. assignments names each assigned column with whether its value is DEFAULT.
Auto Trait Implementations§
impl Freeze for GeneratedValueColumns
impl RefUnwindSafe for GeneratedValueColumns
impl Send for GeneratedValueColumns
impl Sync for GeneratedValueColumns
impl Unpin for GeneratedValueColumns
impl UnsafeUnpin for GeneratedValueColumns
impl UnwindSafe for GeneratedValueColumns
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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