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

array mode #18

Open
tantaman opened this issue Jul 23, 2023 · 2 comments
Open

array mode #18

tantaman opened this issue Jul 23, 2023 · 2 comments
Labels

Comments

@tantaman
Copy link
Contributor

Users may want to select relations (arrays or arrays) rather than objects.

I.e.,

SELECT * FROM foo -> [[1,2,3],[4,5,6],...]

vs

SELECT * FROM foo -> [
  { a: 1, b: 2, c: 3}, ...
]
@Azarattum
Copy link
Collaborator

Should this be setup on per query or per connection basis? If we want it per query then we also need a way for users to provide different execution functions (object and array based).

What are the common use cases when you would want an array rather than an object?

@tantaman
Copy link
Contributor Author

Slightly better efficiency?

The only other thing I can think of is better ergonomics for things like self-joins.

E.g.,

SELECT * FROM foo JOIN foo

without an array mode you'd need to alias every column.

Of course there's plenty of arguments that relying on the position of your data is a really bad practice. Tagging this as low priority.

@tantaman tantaman added the low label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants