Delete prepared query using WriteOptions (#2417)

This commit is contained in:
Mike Cowgill 2016-11-03 12:54:07 -07:00 committed by Kyle Havlovitz
parent 1d35ff27ef
commit ace3b46432
1 changed files with 5 additions and 6 deletions

View File

@ -167,19 +167,18 @@ func (c *PreparedQuery) Get(queryID string, q *QueryOptions) ([]*PreparedQueryDe
} }
// Delete is used to delete a specific prepared query. // Delete is used to delete a specific prepared query.
func (c *PreparedQuery) Delete(queryID string, q *QueryOptions) (*QueryMeta, error) { func (c *PreparedQuery) Delete(queryID string, q *WriteOptions) (*WriteMeta, error) {
r := c.c.newRequest("DELETE", "/v1/query/"+queryID) r := c.c.newRequest("DELETE", "/v1/query/"+queryID)
r.setQueryOptions(q) r.setWriteOptions(q)
rtt, resp, err := requireOK(c.c.doRequest(r)) rtt, resp, err := requireOK(c.c.doRequest(r))
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer resp.Body.Close() defer resp.Body.Close()
qm := &QueryMeta{} wm := &WriteMeta{}
parseQueryMeta(resp, qm) wm.RequestTime = rtt
qm.RequestTime = rtt return wm, nil
return qm, nil
} }
// Execute is used to execute a specific prepared query. You can execute using // Execute is used to execute a specific prepared query. You can execute using