-
Notifications
You must be signed in to change notification settings - Fork 186
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
Implementation of embedded client #2297
base: main
Are you sure you want to change the base?
Conversation
172076c
to
def5564
Compare
86fa1a4
to
d3fd28a
Compare
ea6edeb
to
c0e4d05
Compare
d302051
to
71f6e0e
Compare
71f6e0e
to
78ce6d0
Compare
which talks to electric over the internal api, not http
78ce6d0
to
db7c4a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice !
quote( | ||
do: %ControlMessage{ | ||
control: :up_to_date, | ||
offset: offset(unquote(tx), unquote(op)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still include offsets in the control messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never did on the wire, actually
@@ -47,6 +47,10 @@ defmodule Electric.Plug.Utils do | |||
end) | |||
end | |||
|
|||
def parse_columns_param([col | _] = columns) when is_binary(col) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: techincally just ensuring the first col is binary (and not if they are valid postgres identifiers) - you could potentially have the string splitting in L34 as a separate step and then recursively call into itself to do the rest of the parsing?
def type, do: {:array, :string} | ||
|
||
def cast([_ | _] = columns) do | ||
{:ok, Enum.map(columns, &to_string/1)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: potentially worth passing through the parser again to check that they are valid pg identifiers etc? see above comment
which talks to electric over the internal api, not http