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

Add ordered keys as meta-data to the result-seq #142

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rm-hull
Copy link
Collaborator

@rm-hull rm-hull commented Jul 11, 2013

Presently there is no way to determine the order of fields retrieved out of any SQL that was executed, because the row data is slotted into a hash-map, and the ordering is lost. I did consider changing this to use an array-map, but this only works up to 16 elements, and in any regard, this is copy-on-write so performance is not great.

Instead, the ordered keys are added as meta data to the result-seq, so they can be extracted out as follows:

  (with-results [res query]
    (let [cols (:column-names (meta res))]
      ...    

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

Successfully merging this pull request may close these issues.

1 participant