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

Setting new values does not work with fully qualified keywords in PostgreSQL #317

Closed
aratare-jp opened this issue Apr 1, 2021 · 2 comments
Assignees
Labels
bug It's broken, I'll fix it!
Milestone

Comments

@aratare-jp
Copy link

Context

I'm trying to update a row in a PostgreSQL table with the following code:

(def data {:foo/bar 1})

(-> (helpers/update :user)
    (helpers/set data)
    (helpers/where [:= :user/id id])
    (helpers/returning :*)
    (sql/format {:dialect :ansi}))

Problem

The above query will fail because:

  • HoneySQL will translate such query into ... SET "foo"."bar" = 1 ..., and
  • PostgreSQL does not accept table name in SET clause.

Expected behaviour

There should be a way to disable inclusion of table name in SET clause for PostgreSQL, or this should be handled by default.

@seancorfield
Copy link
Owner

You can either use a :git/url dep with :sha "06f25ed2e3f96abce4920feca6034f954e138277" or wait for the next alpha build.

@seancorfield seancorfield added the bug It's broken, I'll fix it! label Apr 1, 2021
@seancorfield seancorfield added this to the 2.0.0 milestone Apr 1, 2021
@seancorfield seancorfield self-assigned this Apr 1, 2021
@aratare-jp
Copy link
Author

Will do. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's broken, I'll fix it!
Projects
None yet
Development

No branches or pull requests

2 participants