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 support #36

Closed
szlend opened this issue Apr 29, 2019 · 5 comments
Closed

Array support #36

szlend opened this issue Apr 29, 2019 · 5 comments

Comments

@szlend
Copy link

szlend commented Apr 29, 2019

Are there any plans for adding support for Arrays? I would be interested in implementing this myself (with some guidance) if not.

I tried to look if I could implement this using existing building blocks in the library, but I got stuck immediately in types::Value. The first idea was to make the enum recursive by adding Array(List<Value>) to it. However this would allow mixing different types. We could make a new Array type like struct Array (SqlType, List<Value>) which wouldn't allow inserting different values, though that is still pretty inefficient. I think the most efficient way would be to make
Value generic like Value<T = ()> and then we could add an Array(List<T>) to the enum.

I'm not sure what the best approach would be here. What do you think?

@suharev7
Copy link
Owner

suharev7 commented May 2, 2019

I have not any plans for adding support for Arrays (at least in the foreseeable future), so it would be great if you could implement it and feel free to ask any question if you need.
I think Array type like Array(SqlType, List<Value>) would be best to choose because it will allow getting the type of empty list.

@hwchen
Copy link
Contributor

hwchen commented Jun 25, 2019

Any movement on this? This might be useful to me in the near future, and I would be willing to implement.

@szlend
Copy link
Author

szlend commented Jun 25, 2019

Hey, sorry but I got stuck on something pretty early on and I needed a solution fast so I just worked around it by converting the array into a comma delimited string. I might attempt it again because I know I'll need it for inserts eventually, but definitely not in the following two months.

@suharev7
Copy link
Owner

suharev7 commented Jul 16, 2019

I have added a basic implementation of arrays, and it's available since v0.1.13.
You can check out an example here.

@hwchen
Copy link
Contributor

hwchen commented Jul 17, 2019

wow, that's awesome, thanks!

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

3 participants