Skip to content
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 on GitHub? Sign in to your account

Logical Upsert example does not work #26

Open
MB175 opened this issue Apr 6, 2023 · 1 comment
Open

Logical Upsert example does not work #26

MB175 opened this issue Apr 6, 2023 · 1 comment

Comments

@MB175
Copy link

MB175 commented Apr 6, 2023

https://fenos.github.io/dqlx/docs/mutations/set

The example has a dot to much and does not work since the type does not fit

data := []map[string]interface{}{
    {
        "uid": "uid(v)",
        "email": "user@company1.io",
        "name": "first name"
    },
}

userByEmailQuery := dqlx.Query(dqlx.EqFn("email", "user@company1.io")).  
    .Select(` // There shouldn't be a Dot here
        v as uid
        name
    `)

resp, err := db.Mutation().
    Query(userByEmailQuery).  // Type does not implement 'DQLizer'
    Set(data).
    Execute(ctx)
@MB175
Copy link
Author

MB175 commented Apr 12, 2023

dqlx/query.go

Line 101 in 8ff4e72

func (builder QueryBuilder) ToDQL() (query string, args map[string]string, err error) {

Does not satisfy

dqlx/dqlx.go

Line 16 in 8ff4e72

ToDQL() (query string, args []interface{}, err error)

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

1 participant