Skip to content

Commit

Permalink
Merge pull request #56 from siyopao/patch-1
Browse files Browse the repository at this point in the history
Add a test (hence example) for updating the set type
  • Loading branch information
mpenet authored Apr 29, 2019
2 parents 293e603 + c9c4faf commit eb12ed7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/qbits/hayt/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@
"INSERT INTO test (v1, c, k) VALUES (null, 1, 0);"
(insert :test (values [[:v1 nil] [:c 1] [:k 0]]))

"UPDATE users SET emails = emails + {'[email protected]'} WHERE id = 73;"
(update :users
(set-columns {:emails
[+ #{"[email protected]"}]})
(where [[= :id 73]]))

"UPDATE user_profiles SET addresses = addresses + {'work' : {city : 'Santa Clara', street : '3975 Freedom Circle Blvd', zip : 95050}} WHERE login = 'tsmith';"
(update :user_profiles
(set-columns {:addresses
Expand Down

0 comments on commit eb12ed7

Please sign in to comment.