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

sqlite3 column names "oid" and "_rowid_" are not returned in a results hash #6

Open
tbrowder opened this issue Apr 13, 2019 · 2 comments

Comments

@tbrowder
Copy link

tbrowder commented Apr 13, 2019

Quoting from the SQLIte docs:

Except for WITHOUT ROWID tables, all rows within SQLite tables have a 64-bit signed
integer key that uniquely identifies the row within its table. This integer is usually
called the "rowid". The rowid value can be accessed using one of the special
case-independent names "rowid", "oid", or "_rowid_" in place of a column name. 

DB::SQLite does recognize "oid" or "_rowid_" in a select query, but neither shows up as a hash key when used. Only the %hash<rowid> key is recognized regardless of the column name used in the select query.

@CurtTilmes
Copy link
Owner

CurtTilmes commented Apr 15, 2019

That's just the way SQLite works -- 'oid' and _rowid_ are just aliases to access the 'rowid' with is named 'rowid' by default.

You can do "select oid as oid, blah from foo" and it will use the name you specified.

@tbrowder
Copy link
Author

Isn't that worth mentioning in the README.md? I would propose something, but your writing is so tight and well-structured I wouldn't dare!

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

2 participants