8000 Using sqljson.Append with Upsert operation · Issue #3487 · ent/ent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Using sqljson.Append with Upsert operation #3487
Closed
@seinshah

Description

@seinshah

I'm trying to get the benefit of using sqljson.Append function to merge my jsonb column with the new value during the upsert operation and when the ON CONFLICT triggers.

sqljson.Append function accepts *sql.UpdateBuilder as the first argument. I couldn't find a way to access the builder during the Upsert operation and it seems that unlike update operation, Modify method is not generated for Upsert.

Is there anyway to access the UpdateBuilder during upsert to use it here:

Update(func(eu *ent.EntityUpsert) {...})

or otherwise, is it possible to add a method such as GetBuilder to *sql.UpdateSet. e.g.

Update(func(eu *ent.EntityUpsert) {
    sqljson.Append(eu.UpdateSet.GetBuilder(), ...)
})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0