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

OnConflict(sql.ConflictColumns(...)). Update(func(u *ent.UserUpsert){u.SetTags([]string("a", "b"))}) not support string arrray #4018

Open
2 tasks done
dairongpeng opened this issue Apr 15, 2024 · 0 comments

Comments

@dairongpeng
Copy link

OnConflict(sql.ConflictColumns(...)). Update(func(u *ent.UserUpsert){u.SetTags([]string("a", "b"))}) not support string arrray, tags is definitions like the following field.Strings("tags").Optional()

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

client.User.
    Create().
    OnConflict(
        sql.ConflictColumns(user.FieldID),
    ).
    Update(func(u *ent.UserUpsert) {
        u.SetTags([]string("a", "b"))
    }).Exec(ctx)

postgresql on conflict upsert unsupported type []string
{"err": "sql: converting argument $36 type: unsupported type []string, a slice of string"}

Tech Version
Go 1.22.1
Ent v0.13.1
Database PG
Driver https://go.dev/src/database/sql/driver/driver.go
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