Skip to content

docs: add documentation on channel identifier, closes #18 #19

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

Merged
merged 4 commits into from
Apr 17, 2025
Merged
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
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# libcluster Postgres Strategy
# Libcluster Postgres Strategy

[![Hex version badge](https://img.shields.io/hexpm/v/libcluster_postgres.svg)](https://hex.pm/packages/libcluster_postgres)
[![License badge](https://img.shields.io/hexpm/l/libcluster_postgres.svg)](https://github.com/supabase/libcluster_postgres/blob/main/LICENSE)
Expand All @@ -18,7 +18,9 @@ by adding `libcluster_postgres` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[{:libcluster_postgres, "~> 0.1"}]
[
{:libcluster_postgres, "~> 0.1"}
]
end
```

Expand All @@ -37,6 +39,7 @@ config :libcluster,
password: "postgres",
database: "postgres",
port: 5432,
# optional, connection parameters. Defaults to []
parameters: [],
# optional, defaults to false
ssl: true,
Expand All @@ -45,7 +48,10 @@ config :libcluster,
# optional, please refer to the Postgrex docs
socket_options: nil,
# optional, defaults to node cookie
channel_name: "cluster"
# must be a valid postgres identifier (alphanumeric and underscores only) with valid length
channel_name: "cluster",
# optional, heartbeat interval in ms. defaults to 5s
heartbeat_interval: 10_000
],
]
]
Expand Down
2 changes: 1 addition & 1 deletion lib/strategy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule LibclusterPostgres.Strategy do
ssl: Keyword.get(state.config, :ssl),
ssl_opts: Keyword.get(state.config, :ssl_opts),
socket_options: Keyword.get(state.config, :socket_options, []),
parameters: Keyword.fetch!(state.config, :parameters),
parameters: Keyword.get(state.config, :parameters, []),
channel_name: channel_name
]

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule LibclusterPostgres.MixProject do
[
name: "libcluster_postgres",
app: :libcluster_postgres,
version: "0.1.2",
version: "0.1.3",
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down