forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
query_executor.go
26 lines (20 loc) · 944 Bytes
/
query_executor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package influxql
import (
"errors"
"fmt"
)
// QueryExecutor executes every statement in an Query.
type QueryExecutor interface {
ExecuteQuery(query *Query, database string, chunkSize int, closing chan struct{}) <-chan *Result
}
var (
// ErrInvalidQuery is returned when executing an unknown query type.
ErrInvalidQuery = errors.New("invalid query")
// ErrNotExecuted is returned when a statement is not executed in a query.
// This can occur when a previous statement in the same query has errored.
ErrNotExecuted = errors.New("not executed")
)
// ErrDatabaseNotFound returns a database not found error for the given database name.
func ErrDatabaseNotFound(name string) error { return fmt.Errorf("database not found: %s", name) }
// ErrMeasurementNotFound returns a measurement not found error for the given measurement name.
func ErrMeasurementNotFound(name string) error { return fmt.Errorf("measurement not found: %s", name) }