MCPcopy Create free account
hub / github.com/RedisGraph/redisgraph-go / QueryWithOptions

Method QueryWithOptions

graph.go:151–164  ·  view source on GitHub ↗

QueryWithOptions issues a query with the given timeout

(q string, options *QueryOptions)

Source from the content-addressed store, hash-verified

149
150// QueryWithOptions issues a query with the given timeout
151func (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
167func (g *Graph) ParameterizedQueryWithOptions(q string, params map[string]interface{}, options *QueryOptions) (*QueryResult, error) {

Callers 2

TestTimeoutFunction · 0.80

Calls 1

QueryResultNewFunction · 0.85

Tested by 1

TestTimeoutFunction · 0.64