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

return symbolized keys when using results_as_hash = true #155

Closed
audibleblink opened this issue Apr 22, 2015 · 0 comments · Fixed by #486
Closed

return symbolized keys when using results_as_hash = true #155

audibleblink opened this issue Apr 22, 2015 · 0 comments · Fixed by #486
Assignees
Milestone

Comments

@audibleblink
Copy link

Currently returning thousands of records with string instances as keys. Seems wasteful.

[12] pry(main)> DB.execute("select * from politicians")[0].keys.first.object_id # is String: "name"
=> 70139106472200
[13] pry(main)> DB.execute("select * from politicians")[1].keys.first.object_id # is String: "name"
=> 70139116927900
@tenderlove tenderlove self-assigned this Jan 24, 2024
tenderlove added a commit that referenced this issue Jan 24, 2024
When we get column names back from the database, it's very common to
always return the same strings. This patch uses Ruby's "interned string"
API so that we're always getting the same string objects back from the database.

Fixes: #155
tenderlove added a commit that referenced this issue Jan 24, 2024
When we get column names back from the database, it's very common to
always return the same strings. This patch uses Ruby's "interned string"
API so that we're always getting the same string objects back from the database.

Fixes: #155
tenderlove added a commit that referenced this issue Jan 24, 2024
When we get column names back from the database, it's very common to
always return the same strings. This patch uses Ruby's "interned string"
API so that we're always getting the same string objects back from the database.

Fixes: #155
@tenderlove tenderlove added this to the 2.0.0 milestone Jan 24, 2024
tenderlove added a commit that referenced this issue Jan 25, 2024
When we get column names back from the database, it's very common to
always return the same strings. This patch uses Ruby's "interned string"
API so that we're always getting the same string objects back from the database.

Fixes: #155
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 a pull request may close this issue.

2 participants