Skip to content

Add .upsert() impl #18

@trevyn

Description

@trevyn

With SQLite INSERT OR REPLACE INTO

or

execute!(
    "INSERT INTO node(host, id)"
    "VALUES (" host, node.id ")"
    "ON CONFLICT(host) DO UPDATE SET id = " node.id
)?;
Node {
    host: Some(host),
    id: Some(node.id),
    ..Default::default()
}.upsert_on("host")?;
upsert!(Node { host, id: node.id });
insert!(Node { host, id: node.id });

Oh dear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions