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

Refactor InfluxDbQuery to more ergonomic handling #31

Open
Empty2k12 opened this issue Oct 11, 2019 · 0 comments
Open

Refactor InfluxDbQuery to more ergonomic handling #31

Empty2k12 opened this issue Oct 11, 2019 · 0 comments

Comments

@Empty2k12
Copy link
Collaborator

This issue captures some discussion from #21

@pcpthm and @Drevoed suggest refactoring the query to something like this, removing the InfluxDbQuery trait and instead turning that into an Enum.

pub enum InfluxDbQuery {
    Write(InfluxDbWriteQuery),
    Read(InfluxDbReadQuery)
}

impl InfluxDbQuery {
    pub fn build(&self) -> Result<ValidQuery, InfluxDbError> {
        use InfluxDbQuery::*;
        
        match self {
            Write(write_query) => write_query.build(),
            Read(read_query) => read_query.build()
        }
    }
}
@Empty2k12 Empty2k12 self-assigned this Oct 11, 2019
@Empty2k12 Empty2k12 added this to To do in influxdb-rust via automation Oct 11, 2019
@Empty2k12 Empty2k12 added this to the Release 0.0.6 milestone Oct 11, 2019
@msrd0 msrd0 removed this from the Release 0.0.6 milestone Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
influxdb-rust
  
To do
Development

No branches or pull requests

2 participants