Skip to content

Refactor InfluxDbQuery to more ergonomic handling  #31

Open
@Empty2k12

Description

@Empty2k12

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()
        }
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions