Skip to content

How to bulk insert/upsert? #88

@brielov

Description

@brielov

I have to sync an xml feed with a postgres database. So far, I download and parse the xml and then I do:

const products = [...]
sql`insert into products ${sql(products, 'sku', 'title')}`

The first time runs fine, but when it encounters a duplicatte sku it fails, so how could I handle on conflict (sku) do update... using this approach?

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