8000 Upsert is not working · Issue #7 · fenos/dqlx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upsert is not working #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already 8000 on GitHub? Sign in to your account

Open
panakour opened this issue Oct 7, 2021 · 2 comments
Open

Upsert is not working #7

panakour opened this issue Oct 7, 2021 · 2 comments

Comments

@panakour
Copy link
Contributor
panakour commented Oct 7, 2021

Hi, thank you for your library,

I was trying to make an upsert block https://dgraph.io/docs/mutations/upsert-block/#example-of-uid-function and I see in your documentation: https://fenos.github.io/dqlx/docs/mutations/set#logical-upsert the way to do it. But there is a type error.

In your example you add a Query in the mutation like this:

resp, err := db.Mutation().
    Query(userByEmailQuery).
    Set(data).
    Execute(ctx)

but the query method has a dependency on an interface DQLizer which has the method signature: ToDQL() (query string, args []interface{}, err error)

Using the query builder in your example:

userByEmailQuery := dqlx.Query(dqlx.EqFn("email", "user@company1.io")).
    .Select(`
        v as uid
        name
    `)

given us an instance of QueryBuilder which has the method ToDQL() (query string, args map[string]string, err error) that is not match to the DQLizer method:

@dtrckd
Copy link
dtrckd commented Dec 24, 2021

Hi @panakour, is this is fix in new version ?

@LockedThread
Copy link

Hi @panakour, is this is fix in new version ?

Yes, this was fixed in the new version.

Repository owner deleted a comment from araphp1 Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0