diff --git a/client_test.go b/client_test.go index 7fb66fe..6921ab0 100644 --- a/client_test.go +++ b/client_test.go @@ -133,7 +133,7 @@ func TestClient_IntersectMembersToSegment(t *testing.T) { func TestClient_ExecuteDynamicQuery(t *testing.T) { client := getClient(t) - resp, err := client.ExecuteDynamicQuery(makeQuery(makeCondition()), false) + resp, err := client.ExecuteDynamicQuery(makeQuery(makeCondition()), false, 10) if err != nil { t.Fatalf("Unexpected error: %v", err) } @@ -149,7 +149,7 @@ func TestClient_ExecuteDynamicQuery(t *testing.T) { func TestClient_ExecuteDynamicQueryWithWindowing(t *testing.T) { client := getClient(t) - resp, err := client.ExecuteDynamicQuery(makeWindowingQuery(), false) + resp, err := client.ExecuteDynamicQuery(makeWindowingQuery(), false, 10) if err != nil { t.Fatalf("Unexpected error: %v", err) } @@ -170,7 +170,7 @@ func TestClient_ExecuteDynamicQueryWithError(t *testing.T) { client := getClient(t) query := makeQuery(makeCondition()) query.Table = "foobar" - resp, err := client.ExecuteDynamicQuery(query, false) + resp, err := client.ExecuteDynamicQuery(query, false, 10) if err != nil { t.Fatalf("Unexpected error: %v", err) diff --git a/dynamic_query.go b/dynamic_query.go index 97ee968..1d122ff 100644 --- a/dynamic_query.go +++ b/dynamic_query.go @@ -11,14 +11,18 @@ type ExecuteDynamicQueryResponse struct { Results []interface{} `mapstructure:"results" json:"results"` ResultCount int `mapstructure:"result_count" json:"result_count"` CompiledSQL string `mapstructure:"compiled_sql" json:"compiled_sql,omitempty"` + TTLHash string `mapstructure:"ttl_hash" json:"ttl_hash,omitempty"` + TTLStart string `mapstructure:"ttl_start" json:"ttl_start,omitempty"` + TTLExpiry string `mapstructure:"ttl_expiry" json:"ttl_expiry,omitempty"` Error string `mapstructure:"error,omitempty" json:"error,omitempty"` } // ExecuteDynamicQuery returns the query results -func (c Client) ExecuteDynamicQuery(query dynamicquery.Query, debug bool) (*ExecuteDynamicQueryResponse, error) { +func (c Client) ExecuteDynamicQuery(query dynamicquery.Query, debug bool, ttlSeconds int) (*ExecuteDynamicQueryResponse, error) { var input = make(map[string]interface{}) input["query"] = query input["debug"] = debug + input["ttl_seconds"] = ttlSeconds var response ExecuteDynamicQueryResponse