Skip to content

Allow for transformation of messages from the upstream server before passing to clients #53

@thruflo

Description

@thruflo

I've implemented proxying in Elixir in front of Electric before. For example, in the gatekeeper auth example: https://github.com/electric-sql/electric/blob/main/examples/gatekeeper-auth/api/lib/api_web/controllers/proxy_controller.ex using Req in streaming mode.

I'm now working on a Phoenix.Sync app and have been eyeballing:

  1. how best to implement a proxying controller
  2. whether we can extract some logic to make this easier / build some proxy apis into Phoenix.Sync

My main question is how to get a "response" from Electric in embedded mode. I.e.: Phoenix.Sync has :embedded mode. When proxying, there isn't necessarily an upstream URL to proxy to.

Is there a way to make a request to the embedded Electric? If not, would exposing an internal shape and then proxying to that internal route be a workaround?

I suspect the answer to this would inform how to approach providing function or even macro APIs.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions