Skip to main content

HasUpserts

Trait HasUpserts 

Source
pub trait HasUpserts {
    // Required method
    fn upserts_mut(&mut self) -> &mut Vec<ConflictClause>;
}
Expand description

An INSERT’s upsert-clause list.

SQLite 3.35 and later accept several, tried in order:

INSERT … ON CONFLICT (a) DO UPDATE SET … ON CONFLICT DO NOTHING

with the rule that only the last may omit its conflict target. PostgreSQL has exactly one ON CONFLICT, which is why Conflict is a single slot and this is a list instead. The clause itself is core’s ConflictClause — SQLite’s ON CONFLICT (cols) [WHERE …] DO { NOTHING | UPDATE SET … [WHERE …] } is that shape exactly, minus the ON CONSTRAINT target, for which no mod is exported.

Required Methods§

Source

fn upserts_mut(&mut self) -> &mut Vec<ConflictClause>

The upsert clauses to modify.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HasUpserts for Vec<ConflictClause>

Source§

fn upserts_mut(&mut self) -> &mut Vec<ConflictClause>

Implementors§