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

Add support for vectors and complex data types #41

Open
tglman opened this issue Dec 25, 2019 · 1 comment
Open

Add support for vectors and complex data types #41

tglman opened this issue Dec 25, 2019 · 1 comment

Comments

@tglman
Copy link

tglman commented Dec 25, 2019

Hi,

Would be cool have support for other DBMS not strictly purely SQL based DBMS, the API defined so far are generic enough that could be used also with some NoSql DBMS, the missing part at this stage I think is the support for more advanced types, in the specific I think would be enough to add a collection type so adding to ResultSet:

    fn get_vec_i8(&self, i: u64) -> Result<Option<Vec<i8>>>;
    fn get_vec_i16(&self, i: u64) -> Result<Option<Vec<i16>>>;
    fn get_vec_i32(&self, i: u64) -> Result<Option<Vec<i32>>>;
    fn get_vec_i64(&self, i: u64) -> Result<Option<Vec<i64>>>;
    fn get_vec_f32(&self, i: u64) -> Result<Option<Vec<f32>>>;
    fn get_vec_f64(&self, i: u64) -> Result<Option<Vec<f64>>>;
    fn get_vec_string(&self, i: u64) -> Result<Option<Vec<String>>>;
    fn get_vec_bytes(&self, i: u64) -> Result<Option<Vec<Vec<u8>>>>;

As well adding a sort of nested type

   // ResultSet
   fn get_vec_value(&self, i: u64) -> Result<Option<Vec<Value>>>;
   fn get_vec_value(&self, i: u64) -> Result<Option<Value>>;
  // Nested Type
  trait Value {
     //Same signatures of ResultSet for access values
  }

Another important part i think is the named access to values, often there is also a name associate to a value and may not be there at all a position.
So maybe would be cool to have also the relative methods:

    fn get_named_i8(&self, name: &str) -> Result<Option<i8>>;
    // And all the other types combinations.

If you are interested to this I can also write a PR for this cases.
Regards

@andygrove
Copy link
Contributor

I went through a similar effort with Apache Arrow and there is a DataType enum there that supports structured types. Maybe we can take some inspiration from that.

https://github.com/apache/arrow/blob/master/rust/arrow/src/datatypes.rs#L53-L81

@andygrove andygrove changed the title Support for not only RDBMS but also other DBMS. Add supported for vectors and complex data types Jan 14, 2020
@andygrove andygrove changed the title Add supported for vectors and complex data types Add support for vectors and complex data types Jan 14, 2020
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