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

Event forwarding #6

Closed
cpursley opened this issue Dec 17, 2021 · 6 comments
Closed

Event forwarding #6

cpursley opened this issue Dec 17, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@cpursley
Copy link
Owner

cpursley commented Dec 17, 2021

Add webhook forwarding of events that is configurable by yaml. This way you wouldn't even need to touch Elixir.

Hasura Event Trigger yaml format: https://hasura.io/docs/latest/graphql/core/event-triggers/create-trigger.html

Or consider a similar config: https://github.com/subzerocloud/pg-event-proxy-example/blob/master/config_example.ini

Also see Supabase

@cpursley cpursley added the enhancement New feature or request label Dec 17, 2021
@cpursley
Copy link
Owner Author

Another idea is ability to transform requests: https://hasura.io/docs/latest/api-reference/kriti-templating/

^ but perhaps better suited for a different library

@cpursley cpursley closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2023
@cpursley cpursley reopened this Jul 25, 2023
@cpursley cpursley changed the title Webhook Event forwarding Event forwarding Jul 25, 2023
@cpursley cpursley mentioned this issue Sep 22, 2023
@cpursley
Copy link
Owner Author

cpursley commented Dec 5, 2023

When casting to json, remove to Elixir map_diff specific columns:

"changes": {
    "event_id": {
      "added": "35ff67b6-4b9c-43f3-b51b-d2b7770e5796",
      "changed": "primitive_change",
      "removed": "6c59f0ed-e45b-44a7-98df-c2976835e875"
    },
    "updated_at": {
      "added": "2023-11-25T10:52:55.108562-05:00",
      "value": {
        "day": {
          "value": 25,
          "changed": "equal"
        },
        "hour": {
          "value": 10,
          "changed": "equal"
        },
        "year": {
          "value": 2023,
          "changed": "equal"
        },
        "month": {
          "value": 11,
          "changed": "equal"
        },
        "minute": {
          "value": 52,
          "changed": "equal"
        },
        "second": {
          "added": 55,
          "changed": "primitive_change",
          "removed": 54
        },
        "calendar": {
          "value": "Elixir.Calendar.ISO",
          "changed": "equal"
        },
        "time_zone": {
          "value": "Etc/UTC-5",
          "changed": "equal"
        },
        "zone_abbr": {
          "value": "-05",
          "changed": "equal"
        },
        "std_offset": {
          "value": 0,
          "changed": "equal"
        },
        "utc_offset": {
          "value": -18000,
          "changed": "equal"
        },
        "microsecond": {
          "added": [
            108562,
            6
          ],
          "changed": "primitive_change",
          "removed": [
            671907,
            6
          ]
        }
      },
      "changed": "map_change",
      "removed": "2023-11-25T10:52:54.671907-05:00",
      "struct_name": "Elixir.DateTime"
    },

In the above example, that means remove:

  • change type: "changed": "map_change"
  • "value"
  • "struct_name": "Elixir.DateTime"

Maybe keep "value", not sure.

@cpursley
Copy link
Owner Author

cpursley commented Dec 6, 2023

Consider providing option to send in Debezium format.

@cpursley
Copy link
Owner Author

supabase/realtime#33 (comment)

Ability to config similar to this via json.

@cpursley
Copy link
Owner Author

Added ability to forward events via webhooks or to EventRelay: https://github.com/cpursley/walex/releases/tag/v3.2.0

@cpursley
Copy link
Owner Author

See also: https://github.com/eventrelay/eventsql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant