Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(events): add columns about properties #163

Merged
merged 3 commits into from
Jun 18, 2020

Conversation

terry-xiaoyu
Copy link
Contributor

@terry-xiaoyu terry-xiaoyu commented Jun 12, 2020

Add columns about MQTT5.0 Properties in all of the events. The colomns
added this time:

  • pub_props for message.publish, message.dropped and message.delivered

  • conn_props for client.connected

  • disconn_props for client.disconnected

  • sub_props for session.subscribed

  • unsub_props for session.unsubscribed

  • pub_props and puback_props for message.acked

Note that the column headers in message.publish will be removed
in the next major release, as we'd better put all the available columns
at the top-level of the sql selection result.

@terry-xiaoyu terry-xiaoyu force-pushed the properties_in_msg_header branch 2 times, most recently from 154e341 to 845c691 Compare June 17, 2020 11:03
Add columns about MQTT5.0 Properties in all of the events. The colomns
added this time:

- `pub_props` for `message.publish`, `message.dropped` and `message.delivered`

- `conn_props` for `client.connected`

- `disconn_props` for `client.disconnected`

- `sub_props` for `session.subscribed`

- `unsub_props` for `session.unsubscribed`

- `pub_props` and `puback_props` for `message.acked`

Note that the column `headers` in `message.publish` will be removed
in the next major release, as we'd better put all the available columns
at the top-level of the sql selection result.
Columns added in this PR:

- metadata :: #{rule_id := binary(),
                action_id := binary()}
**FOREACH clause should always returns a list of map.**

That is, given the following SQL:

```
FOREACH payload.devices
FROM "t/#"
```

And a input:

```
{"payload": {"devices": [1, 2]}}
```

The output should be:

```
[#{item => 1}, #{item => 2}]
```

And should **NOT** be:

```
[1, 2]
```
@terry-xiaoyu
Copy link
Contributor Author

Add a new column metadata, we will put all rule-related data in it:

  • metadata :: #{rule_id := binary(),
    action_id := binary(),
    atom() => binary() | map()
    }

@terry-xiaoyu
Copy link
Contributor Author

Fix a bug with regards to FOREACH:

FOREACH clause should always returns a list of map.

That is, given the following SQL:

FOREACH payload.devices
FROM "t/#"

And an input:

{"payload": {"devices": [1, 2]}}

The output should be:

[#{item => 1}, #{item => 2}]

And should NOT be:

[1, 2]

@terry-xiaoyu terry-xiaoyu merged commit 60bf0dd into develop Jun 18, 2020
@terry-xiaoyu terry-xiaoyu deleted the properties_in_msg_header branch June 18, 2020 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant