Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ config :my_app, WalEx,
name: MyApp
```

If you would like to subscribe to all tables, you can pass a special atom to subscriptions.

```elixir
config :my_app, WalEx,
url: "postgres://username:password@hostname:port/database",
publication: "events",
subscriptions: [:all_tables],
name: MyApp,
```

You can also dynamically update the config at runtime:

```elixir
Expand Down
2 changes: 1 addition & 1 deletion lib/walex/transaction_filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ defmodule WalEx.TransactionFilter do
def subscribes?(%{table: table}, app_name) do
subscriptions = WalEx.Config.get_configs(app_name, :subscriptions)

table in subscriptions
:all_tables in subscriptions || table in subscriptions
end

def has_table?(%{table: table}, table_name) when is_atom(table), do: table == table_name
Expand Down
Loading