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
I've worked a lot with Laravel and there is a handy thing like DB::connection() that allows you to connect multiple databases to one project. It would be really cool to see it here!
For example:
I use PostgreSQL as my main transactional database
ClickHouse is used to collect certain development metrics and analytics
And I would like to conveniently be able to set all connections through the configuration and refer to them by name
This would be an interesting addition indeed. It would require a design phase so it is correctly included in the framework. This will probably involve breaking changes so it would be pushed back to v6.
In the meantime, you can work around this by opening another connection yourself using database.New(cfg, func() *slog.Logger { return server.Logger }) (or manually as usual in a Go project) and exposing this new connection through a service.
Proposal
Discussion:
I've worked a lot with Laravel and there is a handy thing like
DB::connection()
that allows you to connect multiple databases to one project. It would be really cool to see it here!For example:
And I would like to conveniently be able to set all connections through the configuration and refer to them by name
connection -
pgsql
connection -
ch
connection -
ch_analytics
The text was updated successfully, but these errors were encountered: