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

Enhance programmer methods on Select result #79

Closed
willy610 opened this issue Sep 20, 2020 · 2 comments
Closed

Enhance programmer methods on Select result #79

willy610 opened this issue Sep 20, 2020 · 2 comments
Labels
question Further information is requested

Comments

@willy610
Copy link

Have made some programming around select.
It's a little bit complicated and column names is missing I think.

In order to make glusql competitive to JS, sqlite, PHP and more
I think something like the following is required
Some kind of Displayselected instead od Selected
The outermost SELECT could get this result.
But of course not for an INSERT .. SELECT ...

  1. Column names
  2. Simplified enums on cell values

A: Usage is: iter over colnames in order to display them in order
B: Usage on whole row is: 'simple' item for all column values
C: Usage on columns in a row

let cell = arow[colname.iter().position(|&x| x == "THECOLNAME")

Below is some pseudo Rust for data definitions

All is immutable

enum DisplayCell
{
Str {value:&str},
Int {value:i64},
Float {value:f64},
Empty, // null
Bool {value:&str} // 'true', 'false' or 1,0 for language independancy
}
struct DisplayRow
{
arow:Vec
}

struct Displayselected
{
headers:Vec<&str>,
rows:Vec
}

@panarch panarch added the question Further information is requested label Sep 20, 2020
@panarch
Copy link
Member

panarch commented Sep 20, 2020

  1. Column names
    This is right thing GlueSQL should have.
    But at the same time, it is not related feature with execution layer.
    Fetching column names can be simply done by handling parsed sql AST.
    It would be good to add a new module in src/ to handle this kind of work.

  2. Simplified enums on cell values
    I'm not sure whether this simplified enums are required in this repo or not.

I think this issue is related to gluesql-js.
It has similar function convert.rs.


So, I think it's good to add "1. Column names" as a new issue, but not sure "2. Simplified enums on cell values" is the feature this gluesql core repository needs to have.
How do you think?

@willy610
Copy link
Author

I had a gluesql-rust in mind also.
That is a good interface for an application programmer (like me...)
Look into both gluesql-js and convert.rs

And column names.. Look into that more and make an issue.

Nice coding by the way in convert.rs. And other

Will try make some experiments around a gluesql-rust.rs !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants