You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can set one of `database`, `databases` and `connects_to` in the config file. They will be used to configure the cache databases in `SolidCache::Record#connects_to`.
90
90
91
-
Setting `database` to `cache_db` will configure with:
91
+
If `connects_to` is set, it will be passed directly.
If `connects_to` is set, it will be passed directly.
104
+
And `databases` to `[cache_db, cache_db2]` configures multiple database shards:
105
+
106
+
```yaml
107
+
databases: [cache_db, cache_db2]
108
+
109
+
# equivalent to
110
+
connects_to:
111
+
shards:
112
+
cache_db1:
113
+
writing: :cache_db1
114
+
cache_db2:
115
+
writing: :cache_db2
116
+
```
104
117
105
118
If none of these are set, Solid Cache will use the `ActiveRecord::Base` connection pool. This means that cache reads and writes will be part of any wrapping database transaction.
0 commit comments