Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Westerlind committed Jun 28, 2022
1 parent 47cd4ac commit f7d8118
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stdlib/experimental/iox/iox.flux
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ package iox
// - bucket: IOx bucket to read data from.
// - measurement: Measurement to read data from.
builtin from : (bucket: string, measurement: string) => stream[{A with _time: time}] where A: Record

// @feature labelPolymorphism
builtin from : (bucket: string, measurement: M) => stream[{A with _time: time}] where A: Record, M: Label
21 changes: 21 additions & 0 deletions stdlib/experimental/mqtt/mqtt.flux
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ builtin to : (
A: Record,
B: Record

// @feature labelPolymorphism
builtin to : (
<-tables: stream[{ A with T: time }],
broker: string,
?topic: string,
?qos: int,
?retain: bool,
?clientid: string,
?username: string,
?password: string,
?name: string,
?timeout: duration,
?timeColumn: T = "_time",
?tagColumns: [string],
?valueColumns: [string],
) => stream[B]
where
A: Record,
B: Record,
T: Label

// publish sends data to an MQTT broker using MQTT protocol.
//
// ## Parameters
Expand Down
3 changes: 3 additions & 0 deletions stdlib/experimental/record/record.flux
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ builtin any : A where A: Record
// introduced: 0.134.0
//
builtin get : (r: A, key: string, default: B) => B where A: Record

// @feature labelPolymorphism
builtin get : (r: A, key: C, default: B) => B where A: Record, C: Label
20 changes: 20 additions & 0 deletions stdlib/influxdata/influxdb/influxdb.flux
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,26 @@ builtin to : (
A: Record,
B: Record

// @feature labelPolymorphism
builtin to : (
<-tables: stream[{ A with T: time, M: string }],
?bucket: string,
?bucketID: string,
?org: string,
?orgID: string,
?host: string,
?token: string,
?timeColumn: T = "_time",
?measurementColumn: M = "_measurement",
?tagColumns: [string],
?fieldFn: (r: A) => B,
) => stream[{ A with T: time, M: string }]
where
A: Record,
B: Record,
T: Label,
M: Label

// buckets returns a list of buckets in the specified organization.
//
// ## Parameters
Expand Down
17 changes: 17 additions & 0 deletions stdlib/kafka/kafka.flux
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,20 @@ builtin to : (
) => stream[A]
where
A: Record

// @feature labelPolymorphism
builtin to : (
<-tables: stream[{ A with N: string, T: time }],
brokers: [string],
topic: string,
?balancer: string,
?name: string,
?nameColumn: N = "_measurement",
?timeColumn: T = "_time",
?tagColumns: [string],
?valueColumns: [string],
) => stream[{ A with N: string, T: time }]
where
A: Record,
N: Label,
T: Label

0 comments on commit f7d8118

Please sign in to comment.