QueryWithOptions issues a query with the given timeout
(q string, options *QueryOptions)
| 149 | |
| 150 | // QueryWithOptions issues a query with the given timeout |
| 151 | func (g *Graph) QueryWithOptions(q string, options *QueryOptions) (*QueryResult, error) { |
| 152 | var r interface{} |
| 153 | var err error |
| 154 | if(options.timeout >= 0) { |
| 155 | r, err = g.Conn.Do("GRAPH.QUERY", g.Id, q, "--compact", "timeout", options.timeout) |
| 156 | } else { |
| 157 | r, err = g.Conn.Do("GRAPH.QUERY", g.Id, q, "--compact") |
| 158 | } |
| 159 | if err != nil { |
| 160 | return nil, err |
| 161 | } |
| 162 | |
| 163 | return QueryResultNew(g, r) |
| 164 | } |
| 165 | |
| 166 | // ParameterizedQueryWithOptions issues a parameterized query with the given timeout |
| 167 | func (g *Graph) ParameterizedQueryWithOptions(q string, params map[string]interface{}, options *QueryOptions) (*QueryResult, error) { |