Skip to content

Commit

Permalink
Add single database configuration instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmypoulsen committed Sep 21, 2024
1 parent ba1b1e5 commit 169bef9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Solid Cable is a database-backed Action Cable adapter that keeps messages in a t

> [!NOTE]
> Solid Cable is tested to work with MySQL, SQLite, and PostgreSQL.
>
>
> Action Cable already has a [dedicated PostgreSQL adapter](https://guides.rubyonrails.org/action_cable_overview.html#postgresql-adapter),
> which utilizes the builtin `NOTIFY` command for better performance. However, that
> adapter has an 8kb limit on its payload. Solid Cable is a great alternative if you find yourself
Expand Down Expand Up @@ -52,6 +52,16 @@ production:

Then run `db:prepare` in production to ensure the database is created and the schema is loaded.

### Single database configuration

Running Solid Cable in a separate database is recommended, but it's also possible to use one single database for both the app and the cable. Just follow these steps:

1. Copy the contents of `db/cable_schema.rb` into a normal migration and delete `db/cable_schema.rb`
2. Remove `connects_to` from `config/cable.yml`
3. Migrate your database

You won't have multiple databases, so `database.yml` doesn't need to have primary and cable database.

## Configuration

All configuration is managed via the `config/cable.yml` file. By default, it'll be configured like this:
Expand Down

0 comments on commit 169bef9

Please sign in to comment.