Skip to content

Commit

Permalink
feat: enable recovery when publication is dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
w3b6x9 committed Mar 8, 2021
1 parent e26c3d9 commit 57e5b9c
Show file tree
Hide file tree
Showing 21 changed files with 422 additions and 184 deletions.
2 changes: 1 addition & 1 deletion server/lib/adapters/changes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Protocol.derive(Jason.Encoder, Realtime.Adapters.Changes.NewRecord)
Protocol.derive(Jason.Encoder, Realtime.Adapters.Changes.UpdatedRecord)
Protocol.derive(Jason.Encoder, Realtime.Adapters.Changes.DeletedRecord)
Protocol.derive(Jason.Encoder, Realtime.Adapters.Changes.TruncatedRelation)
Protocol.derive(Jason.Encoder, Realtime.Decoder.Messages.Relation.Column)
Protocol.derive(Jason.Encoder, Realtime.Adapters.Postgres.Decoder.Messages.Relation.Column)
8 changes: 0 additions & 8 deletions server/lib/adapters/postgres/adapter_behavior.ex

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file draws heavily from https://github.com/cainophile/pgoutput_decoder
# License: https://github.com/cainophile/pgoutput_decoder/blob/master/LICENSE

defmodule Realtime.Decoder do
defmodule Realtime.Adapters.Postgres.Decoder do
defmodule Messages do
defmodule(Begin, do: defstruct([:final_lsn, :commit_timestamp, :xid]))
defmodule(Commit, do: defstruct([:flags, :lsn, :end_lsn, :commit_timestamp]))
Expand Down Expand Up @@ -50,15 +50,15 @@ defmodule Realtime.Decoder do
Unsupported
}

alias Realtime.OidDatabase
alias Realtime.Adapters.Postgres.OidDatabase

@doc """
Parses logical replication messages from Postgres
## Examples
iex> decode_message(<<73, 0, 0, 96, 0, 78, 0, 2, 116, 0, 0, 0, 3, 98, 97, 122, 116, 0, 0, 0, 3, 53, 54, 48>>)
%Realtime.Decoder.Messages.Insert{relation_id: 24576, tuple_data: {"baz", "560"}}
%Realtime.Adapters.Postgres.Decoder.Messages.Insert{relation_id: 24576, tuple_data: {"baz", "560"}}
"""
def decode_message(message) when is_binary(message) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# AND typtype = 'b' -- Only basic types
# AND typisdefined -- Ignore undefined types

defmodule Realtime.OidDatabase do
defmodule Realtime.Adapters.Postgres.OidDatabase do
@doc """
Maps a numeric PostgreSQL type ID to a descriptive string.
Expand Down
104 changes: 0 additions & 104 deletions server/lib/adapters/postgres/epgsql_implementation.ex

This file was deleted.

Loading

0 comments on commit 57e5b9c

Please sign in to comment.