influxdata / influxdb-client-swift

InfluxDB (v2+) Client Library for Swift
https://influxdata.github.io/influxdb-client-swift/
MIT License
26 stars 8 forks source link

Update InfluxDB's UI to use new `await` pattern #58

Closed bednar closed 1 year ago

bednar commented 1 year ago

The https://github.com/influxdata/influxdb-client-swift/pull/49 introduces possibility to use async/await for queries and writes instead of callbacks:

let query = """
                from(bucket: "\(self.bucket)")
                    |> range(start: -10m)
                    |> filter(fn: (r) => r["_measurement"] == "cpu")
                    |> filter(fn: (r) => r["cpu"] == "cpu-total")
                    |> filter(fn: (r) => r["_field"] == "usage_user" or r["_field"] == "usage_system")
                    |> last()
                """

print("\nQuery to execute:\n\(query)\n")

let records = try await client.queryAPI.query(query: query)

We have to update the InfluxDB's docs and UI:

http://localhost:8086 > Load Data > Sources > Client Libraries > Swift

Image