query := "SELECT field1, field2 FROM measurement WHERE time > now() - 1h" spec := &parser.QuerySpec{ RawQuery: query, }
spec := &parser.QuerySpec{ RawQuery: query, DefaultDatabase: "mydb", DefaultRetention: "autogen", }In these examples, the QuerySpec object is created with a raw query string and additional parameters such as the default database and retention policy. Overall, the github.com.influxdb.influxdb.parser package is a library used to parse and interpret InfluxDB queries. It provides various utilities and structs such as QuerySpec to make handling queries easier.