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

Support dissoc on plan rows #51

Closed
seancorfield opened this issue Aug 2, 2019 · 1 comment
Closed

Support dissoc on plan rows #51

seancorfield opened this issue Aug 2, 2019 · 1 comment

Comments

@seancorfield
Copy link
Owner

Is your feature request related to a problem? Please describe.
See the following from Slack:

(reduce (fn [a e] (conj a (assoc e :foo 1))) [] (jdbc/plan db ["select * from data limit 10"]))
[...]
(reduce (fn [a e] (conj a (dissoc e :data/id))) [] (jdbc/execute! db ["select * from data limit 10"]))
[..]
(reduce (fn [a e] (conj a (dissoc e :data/id))) [] (jdbc/plan db ["select * from data limit 10"]))
Syntax error (ClassCastException) compiling at (src/next_jdbc_streaming.clj:61:3).
next.jdbc.result_set$mapify_result_set$reify__1973 cannot be cast to clojure.lang.IPersistentMap

Describe the solution you'd like
dissoc should work (create a full row and then remove the named keys).

Describe alternatives you've considered
Use select-keys to get a subset of keys in a hash map.

@seancorfield
Copy link
Owner Author

dissoc is in IPersistentMap which means implementing Java's Iterable and Clojure's Counted as well.

seancorfield added a commit that referenced this issue Aug 2, 2019
Since `str` may be able to realize a row and render it as a string, attempts to print a row use this route to circumvent `print-sequential` failing due to lazy evaluation.
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