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

In a result row, if two fields have the same name, one of the values gets stomped. #21

Open
sconover opened this issue Feb 16, 2011 · 0 comments

Comments

@sconover
Copy link

This is more a "discussion" than an issue.

node-sqlite faithfully implements the row-as-map style expressed in the w3c spec. This is convenient for js programmers as rows are just js objects.

However if you consider a query like:

"select foo.color, bar.color from foo natural join bar"

Since each row is a map, and the key is the field name (i.e. not fully-qualified) every row in the resulting rowset will have only bar.color's value.

A clean way to handle this problem would be to have an alternative row format - that's just the values in an array in proper order, i.e. an array of values instead of the convenient js object. I'd be wiling to brush off my ancient C++ skillz and take a shot at such a thing, but I'd like some guidance / suggestion on how the api should look before I do that...the "query" method seems to be overridden to begin with, so I'm not sure where would be a good place to drop in something like a map of options ( {rowStyle:"array"} ).

Thoughts?

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